(function () {
    function g(a) {
        throw a;
    }
    var h = void 0,
        m = !0,
        n = null,
        p = !1,
        r, aa = aa || {}, s = this;

    function t(a) {
        a = a.split(".");
        for (var b = s, c; c = a.shift();) if (b[c] != n) b = b[c];
            else return n;
        return b
    }
    function ca() {}
    function da(a) {
        a.getInstance = function () {
            return a.af ? a.af : a.af = new a
        }
    }

    function ea(a) {
        var b = typeof a;
        if ("object" == b) if (a) {
                if (a instanceof Array) return "array";
                if (a instanceof Object) return b;
                var c = Object.prototype.toString.call(a);
                if ("[object Window]" == c) return "object";
                if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) return "array";
                if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) return "function"
            } else return "null";
            else if ("function" == b && "undefined" == typeof a.call) return "object";
        return b
    }
    function fa(a) {
        return a !== h
    }
    function ga(a) {
        return "array" == ea(a)
    }
    function ha(a) {
        var b = ea(a);
        return "array" == b || "object" == b && "number" == typeof a.length
    }
    function u(a) {
        return "string" == typeof a
    }
    function ia(a) {
        return "number" == typeof a
    }
    function ja(a) {
        return "function" == ea(a)
    }
    function ka(a) {
        var b = typeof a;
        return "object" == b && a != n || "function" == b
    }
    function la(a) {
        return a[ma] || (a[ma] = ++na)
    }
    var ma = "closure_uid_" + (1E9 * Math.random() >>> 0),
        na = 0;

    function oa(a, b, c) {
        return a.call.apply(a.bind, arguments)
    }
    function pa(a, b, c) {
        a || g(Error());
        if (2 < arguments.length) {
            var d = Array.prototype.slice.call(arguments, 2);
            return function () {
                var c = Array.prototype.slice.call(arguments);
                Array.prototype.unshift.apply(c, d);
                return a.apply(b, c)
            }
        }
        return function () {
            return a.apply(b, arguments)
        }
    }
    function v(a, b, c) {
        v = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? oa : pa;
        return v.apply(n, arguments)
    }

    function qa(a, b) {
        var c = Array.prototype.slice.call(arguments, 1);
        return function () {
            var b = Array.prototype.slice.call(arguments);
            b.unshift.apply(b, c);
            return a.apply(this, b)
        }
    }
    var w = Date.now || function () {
            return +new Date
        };

    function x(a, b) {
        var c = a.split("."),
            d = s;
        !(c[0] in d) && d.execScript && d.execScript("var " + c[0]);
        for (var e; c.length && (e = c.shift());)!c.length && fa(b) ? d[e] = b : d = d[e] ? d[e] : d[e] = {}
    }
    function y(a, b) {
        function c() {}
        c.prototype = b.prototype;
        a.L = b.prototype;
        a.prototype = new c
    }
    Function.prototype.bind = Function.prototype.bind || function (a, b) {
        if (1 < arguments.length) {
            var c = Array.prototype.slice.call(arguments, 1);
            c.unshift(this, a);
            return v.apply(n, c)
        }
        return v(this, a)
    };

    function ra(a, b) {
        for (var c = 1; c < arguments.length; c++) {
            var d = String(arguments[c]).replace(/\$/g, "$$$$");
            a = a.replace(/\%s/, d)
        }
        return a
    }
    function sa(a) {
        return /^[\s\xa0]*$/.test(a)
    }
    function ta(a, b) {
        var c = String(a).toLowerCase(),
            d = String(b).toLowerCase();
        return c < d ? -1 : c == d ? 0 : 1
    }
    function ua(a) {
        return decodeURIComponent(a.replace(/\+/g, " "))
    }

    function va(a) {
        if (!wa.test(a)) return a; - 1 != a.indexOf("&") && (a = a.replace(xa, "&amp;")); - 1 != a.indexOf("<") && (a = a.replace(ya, "&lt;")); - 1 != a.indexOf(">") && (a = a.replace(za, "&gt;")); - 1 != a.indexOf('"') && (a = a.replace(Aa, "&quot;"));
        return a
    }
    var xa = /&/g,
        ya = /</g,
        za = />/g,
        Aa = /\"/g,
        wa = /[&<>\"]/;

    function Ba(a) {
        return -1 != a.indexOf("&") ? "document" in s ? Ca(a) : Da(a) : a
    }

    function Ca(a) {
        var b = {
            "&amp;": "&",
            "&lt;": "<",
            "&gt;": ">",
            "&quot;": '"'
        }, c = document.createElement("div");
        return a.replace(Ea, function (a, e) {
            var f = b[a];
            if (f) return f;
            if ("#" == e.charAt(0)) {
                var k = Number("0" + e.substr(1));
                isNaN(k) || (f = String.fromCharCode(k))
            }
            f || (c.innerHTML = a + " ", f = c.firstChild.nodeValue.slice(0, -1));
            return b[a] = f
        })
    }

    function Da(a) {
        return a.replace(/&([^;]+);/g, function (a, c) {
            switch (c) {
                case "amp":
                    return "&";
                case "lt":
                    return "<";
                case "gt":
                    return ">";
                case "quot":
                    return '"';
                default:
                    if ("#" == c.charAt(0)) {
                        var d = Number("0" + c.substr(1));
                        if (!isNaN(d)) return String.fromCharCode(d)
                    }
                    return a
            }
        })
    }
    var Ea = /&([^;\s<&]+);?/g;

    function Fa(a, b) {
        var c = fa(h) ? a.toFixed(h) : String(a),
            d = c.indexOf("."); - 1 == d && (d = c.length);
        d = Math.max(0, b - d);
        return Array(d + 1).join("0") + c
    }

    function Ga(a, b) {
        for (var c = 0, d = String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), e = String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), f = Math.max(d.length, e.length), k = 0; 0 == c && k < f; k++) {
            var l = d[k] || "",
                q = e[k] || "",
                A = RegExp("(\\d*)(\\D*)", "g"),
                H = RegExp("(\\d*)(\\D*)", "g");
            do {
                var O = A.exec(l) || ["", "", ""],
                    P = H.exec(q) || ["", "", ""];
                if (0 == O[0].length && 0 == P[0].length) break;
                c = ((0 == O[1].length ? 0 : parseInt(O[1], 10)) < (0 == P[1].length ? 0 : parseInt(P[1], 10)) ? -1 : (0 == O[1].length ? 0 : parseInt(O[1], 10)) > (0 == P[1].length ?
                    0 : parseInt(P[1], 10)) ? 1 : 0) || ((0 == O[2].length) < (0 == P[2].length) ? -1 : (0 == O[2].length) > (0 == P[2].length) ? 1 : 0) || (O[2] < P[2] ? -1 : O[2] > P[2] ? 1 : 0)
            } while (0 == c)
        }
        return c
    }
    function Ia(a) {
        return String(a).replace(/\-([a-z])/g, function (a, c) {
            return c.toUpperCase()
        })
    }
    function Ja(a) {
        var b = u(h) ? "undefined".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08") : "\\s";
        return a.replace(RegExp("(^" + (b ? "|[" + b + "]+" : "") + ")([a-z])", "g"), function (a, b, e) {
            return b + e.toUpperCase()
        })
    };
    var Ka = Array.prototype,
        La = Ka.indexOf ? function (a, b, c) {
            return Ka.indexOf.call(a, b, c)
        } : function (a, b, c) {
            c = c == n ? 0 : 0 > c ? Math.max(0, a.length + c) : c;
            if (u(a)) return !u(b) || 1 != b.length ? -1 : a.indexOf(b, c);
            for (; c < a.length; c++) if (c in a && a[c] === b) return c;
            return -1
        }, z = Ka.forEach ? function (a, b, c) {
            Ka.forEach.call(a, b, c)
        } : function (a, b, c) {
            for (var d = a.length, e = u(a) ? a.split("") : a, f = 0; f < d; f++) f in e && b.call(c, e[f], f, a)
        }, Ma = Ka.filter ? function (a, b, c) {
            return Ka.filter.call(a, b, c)
        } : function (a, b, c) {
            for (var d = a.length, e = [], f = 0, k =
                    u(a) ? a.split("") : a, l = 0; l < d; l++) if (l in k) {
                    var q = k[l];
                    b.call(c, q, l, a) && (e[f++] = q)
                }
            return e
        }, Na = Ka.map ? function (a, b, c) {
            return Ka.map.call(a, b, c)
        } : function (a, b, c) {
            for (var d = a.length, e = Array(d), f = u(a) ? a.split("") : a, k = 0; k < d; k++) k in f && (e[k] = b.call(c, f[k], k, a));
            return e
        }, Oa = Ka.some ? function (a, b, c) {
            return Ka.some.call(a, b, c)
        } : function (a, b, c) {
            for (var d = a.length, e = u(a) ? a.split("") : a, f = 0; f < d; f++) if (f in e && b.call(c, e[f], f, a)) return m;
            return p
        }, Pa = Ka.every ? function (a, b, c) {
            return Ka.every.call(a, b, c)
        } : function (a,
            b, c) {
            for (var d = a.length, e = u(a) ? a.split("") : a, f = 0; f < d; f++) if (f in e && !b.call(c, e[f], f, a)) return p;
            return m
        };

    function Qa(a, b) {
        var c = Ra(a, b, h);
        return 0 > c ? n : u(a) ? a.charAt(c) : a[c]
    }
    function Ra(a, b, c) {
        for (var d = a.length, e = u(a) ? a.split("") : a, f = 0; f < d; f++) if (f in e && b.call(c, e[f], f, a)) return f;
        return -1
    }
    function Sa(a, b) {
        return 0 <= La(a, b)
    }
    function Ta(a) {
        return 0 == a.length
    }
    function Ua(a) {
        if (!ga(a)) for (var b = a.length - 1; 0 <= b; b--) delete a[b];
        a.length = 0
    }

    function Va(a, b) {
        var c = La(a, b),
            d;
        (d = 0 <= c) && Ka.splice.call(a, c, 1);
        return d
    }
    function Wa(a) {
        return Ka.concat.apply(Ka, arguments)
    }
    function Ya(a) {
        var b = a.length;
        if (0 < b) {
            for (var c = Array(b), d = 0; d < b; d++) c[d] = a[d];
            return c
        }
        return []
    }
    function Za(a, b) {
        for (var c = 1; c < arguments.length; c++) {
            var d = arguments[c],
                e;
            if (ga(d) || (e = ha(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) a.push.apply(a, d);
            else if (e) for (var f = a.length, k = d.length, l = 0; l < k; l++) a[f + l] = d[l];
            else a.push(d)
        }
    }

    function $a(a, b, c, d) {
        return Ka.splice.apply(a, ab(arguments, 1))
    }
    function ab(a, b, c) {
        return 2 >= arguments.length ? Ka.slice.call(a, b) : Ka.slice.call(a, b, c)
    }
    function bb(a, b) {
        Ka.sort.call(a, b || cb)
    }
    function db(a, b, c) {
        if (!ha(a) || !ha(b) || a.length != b.length) return p;
        var d = a.length;
        c = c || eb;
        for (var e = 0; e < d; e++) if (!c(a[e], b[e])) return p;
        return m
    }
    function cb(a, b) {
        return a > b ? 1 : a < b ? -1 : 0
    }
    function eb(a, b) {
        return a === b
    };

    function fb(a, b) {
        for (var c in a) b.call(h, a[c], c, a)
    }
    function gb(a) {
        for (var b in a) return a[b]
    }
    function hb(a) {
        var b = [],
            c = 0,
            d;
        for (d in a) b[c++] = a[d];
        return b
    }
    function ib(a) {
        var b = [],
            c = 0,
            d;
        for (d in a) b[c++] = d;
        return b
    }
    function jb(a, b, c) {
        for (var d in a) if (b.call(c, a[d], d, a)) return d
    }
    function kb(a, b) {
        var c = jb(a, b, h);
        return c && a[c]
    }
    function lb(a) {
        for (var b in a) return p;
        return m
    }
    function mb(a) {
        var b = {}, c;
        for (c in a) b[c] = a[c];
        return b
    }
    var ob = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");

    function pb(a, b) {
        for (var c, d, e = 1; e < arguments.length; e++) {
            d = arguments[e];
            for (c in d) a[c] = d[c];
            for (var f = 0; f < ob.length; f++) c = ob[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c])
        }
    };

    function qb(a) {
        return a.dataset ? a.dataset.loaded : a.getAttribute("data-" + rb())
    };

    function sb(a, b) {
        a in tb || (tb[a] = []);
        tb[a].push([b, h])
    }
    function ub(a, b) {
        if (a in tb) for (var c = tb[a], d = Array.prototype.slice.call(arguments, 1), e = 0, f = c.length; e < f; e++) c[e] && c[e][0].apply(c[e][1], d)
    }
    function vb(a) {
        a ? a in tb && delete tb[a] : tb = {}
    }
    var tb = {};

    function wb(a) {
        for (var b = 0, c = 0, d = a.length; c < d; ++c) b = 31 * b + a.charCodeAt(c), b %= 4294967296;
        return b
    }
    function rb() {
        return "loaded".replace(/([A-Z])/g, "-$1").toLowerCase()
    };

    function xb(a, b) {
        var c = "js-" + wb(a),
            d = document.getElementById(c),
            e = d && qb(d),
            d = d && !e;
        if (e) b && b();
        else if (b && sb(c, b), !d) var f = yb(a, c, function () {
                if (!qb(f)) {
                    var a = f;
                    a.dataset ? a.dataset.loaded = "true" : a.setAttribute("data-" + rb(), "true");
                    ub(c);
                    vb(c)
                }
            })
    }

    function yb(a, b, c) {
        var d = document.createElement("script");
        d.id = b;
        d.onload = function () {
            setTimeout(c, 0)
        };
        d.onreadystatechange = function () {
            switch (d.readyState) {
                case "loaded":
                case "complete":
                    d.onload()
            }
        };
        d.src = a;
        a = document.getElementsByTagName("head")[0] || document.body;
        a.insertBefore(d, a.firstChild);
        return d
    }
    function zb(a) {
        a = "js-" + wb(a);
        var b = document.getElementById(a);
        b && (vb(a), b.parentNode.removeChild(b))
    };

    function Ab(a, b) {
        xb(a, b)
    };

    function Bb(a) {
        var b = "css-" + wb(a);
        if (!document.getElementById(b)) {
            var c = document.createElement("link");
            c.id = b;
            c.rel = "stylesheet";
            c.href = a;
            a = document;
            (a.getElementsByTagName("head")[0] || a.body).appendChild(c)
        }
    };

    function Cb() {}
    Cb.prototype.o = p;
    Cb.prototype.ma = function () {
        this.o || (this.o = m, this.P())
    };

    function Db(a, b) {
        a.ga || (a.ga = []);
        a.ga.push(v(b, h))
    }
    Cb.prototype.P = function () {
        if (this.ga) for (; this.ga.length;) this.ga.shift()()
    };

    function Eb(a) {
        a && "function" == typeof a.ma && a.ma()
    };

    function Fb() {
        this.b = [];
        this.la = {}
    }
    y(Fb, Cb);
    r = Fb.prototype;
    r.se = 1;
    r.Bc = 0;
    r.aa = function (a, b, c) {
        var d = this.la[a];
        d || (d = this.la[a] = []);
        var e = this.se;
        this.b[e] = a;
        this.b[e + 1] = b;
        this.b[e + 2] = c;
        this.se = e + 3;
        d.push(e);
        return e
    };
    r.va = function (a, b, c) {
        if (a = this.la[a]) {
            var d = this.b;
            if (a = Qa(a, function (a) {
                return d[a + 1] == b && d[a + 2] == c
            })) return this.Ac(a)
        }
        return p
    };
    r.Ac = function (a) {
        if (0 != this.Bc) return this.e || (this.e = []), this.e.push(a), p;
        var b = this.b[a];
        if (b) {
            var c = this.la[b];
            c && Va(c, a);
            delete this.b[a];
            delete this.b[a + 1];
            delete this.b[a + 2]
        }
        return !!b
    };
    r.M = function (a, b) {
        var c = this.la[a];
        if (c) {
            this.Bc++;
            for (var d = ab(arguments, 1), e = 0, f = c.length; e < f; e++) {
                var k = c[e];
                this.b[k + 1].apply(this.b[k + 2], d)
            }
            this.Bc--;
            if (this.e && 0 == this.Bc) for (; c = this.e.pop();) this.Ac(c);
            return 0 != e
        }
        return p
    };
    r.clear = function (a) {
        if (a) {
            var b = this.la[a];
            b && (z(b, this.Ac, this), delete this.la[a])
        } else this.b.length = 0, this.la = {}
    };
    r.nb = function (a) {
        if (a) {
            var b = this.la[a];
            return b ? b.length : 0
        }
        a = 0;
        for (b in this.la) a += this.nb(b);
        return a
    };
    r.P = function () {
        Fb.L.P.call(this);
        delete this.b;
        delete this.la;
        delete this.e
    };
    var Gb = window.yt && window.yt.config_ || {};
    x("yt.config_", Gb);
    var Hb = window.yt && window.yt.tokens_ || {};
    x("yt.tokens_", Hb);
    var Ib = window.yt && window.yt.globals_ || {};
    x("yt.globals_", Ib);
    var Jb = window.yt && window.yt.msgs_ || {};
    x("yt.msgs_", Jb);
    var Kb = window.yt && window.yt.timeouts_ || [];
    x("yt.timeouts_", Kb);
    var Lb = window.yt && window.yt.intervals_ || [];
    x("yt.intervals_", Lb);

    function Mb(a) {
        Nb(Gb, arguments)
    }
    function B(a, b) {
        return a in Gb ? Gb[a] : b
    }
    function Ob(a) {
        Nb(Hb, arguments)
    }

    function C(a) {
        return a in Hb ? Hb[a] : h
    }
    function D(a, b) {
        var c = window.setTimeout(a, b);
        Kb.push(c);
        return c
    }
    function Pb(a, b) {
        var c = window.setInterval(a, b);
        Lb.push(c);
        return c
    }
    function Qb(a) {
        window.clearTimeout(a)
    }
    function Rb(a) {
        Nb(Jb, arguments)
    }
    function Sb(a, b, c) {
        var d = b || {};
        if (a = a in Jb ? Jb[a] : c) for (var e in d) a = a.replace(RegExp("\\$" + e, "gi"), function () {
                    return d[e]
                });
        return a
    }

    function Tb(a, b) {
        var c = B("I18N_PLURAL_RULES") || function (a) {
                return 1 == a ? "one" : "other"
            };
        return (c = a["case" + b] || a[c(b)]) ? c.replace("#", b.toString()) : b + ""
    }
    function Nb(a, b) {
        if (1 < b.length) {
            var c = b[0];
            a[c] = b[1]
        } else {
            var d = b[0];
            for (c in d) a[c] = d[c]
        }
    }
    var Ub = "Microsoft Internet Explorer" == navigator.appName;
    var Vb = t("yt.pubsub.instance_") || new Fb;
    Fb.prototype.subscribe = Fb.prototype.aa;
    Fb.prototype.unsubscribeByKey = Fb.prototype.Ac;
    Fb.prototype.publish = Fb.prototype.M;
    Fb.prototype.clear = Fb.prototype.clear;
    x("yt.pubsub.instance_", Vb);

    function E(a, b, c) {
        var d = t("yt.pubsub.instance_");
        return d ? d.subscribe(a, function () {
            var a = arguments;
            D(function () {
                b.apply(c || s, a)
            }, 0)
        }, c) : 0
    }

    function Wb(a) {
        var b = t("yt.pubsub.instance_");
        b && ("number" == typeof a ? a = [a] : "string" == typeof a && (a = [parseInt(a, 10)]), z(a, function (a) {
            b.unsubscribeByKey(a)
        }))
    }
    function F(a, b) {
        var c = t("yt.pubsub.instance_");
        return c ? c.publish.apply(c, arguments) : p
    };

    function Xb(a, b) {
        this.x = fa(a) ? a : 0;
        this.y = fa(b) ? b : 0
    }
    r = Xb.prototype;
    r.N = function () {
        return new Xb(this.x, this.y)
    };

    function Yb(a, b) {
        return new Xb(a.x - b.x, a.y - b.y)
    }
    r.ceil = function () {
        this.x = Math.ceil(this.x);
        this.y = Math.ceil(this.y);
        return this
    };
    r.floor = function () {
        this.x = Math.floor(this.x);
        this.y = Math.floor(this.y);
        return this
    };
    r.round = function () {
        this.x = Math.round(this.x);
        this.y = Math.round(this.y);
        return this
    };
    r.scale = function (a, b) {
        var c = ia(b) ? b : a;
        this.x *= a;
        this.y *= c;
        return this
    };

    function Zb(a, b) {
        this.width = a;
        this.height = b
    }
    r = Zb.prototype;
    r.N = function () {
        return new Zb(this.width, this.height)
    };
    r.ceil = function () {
        this.width = Math.ceil(this.width);
        this.height = Math.ceil(this.height);
        return this
    };
    r.floor = function () {
        this.width = Math.floor(this.width);
        this.height = Math.floor(this.height);
        return this
    };
    r.round = function () {
        this.width = Math.round(this.width);
        this.height = Math.round(this.height);
        return this
    };
    r.scale = function (a, b) {
        var c = ia(b) ? b : a;
        this.width *= a;
        this.height *= c;
        return this
    };
    var $b, ac, bc, cc, dc, ec;

    function fc() {
        return s.navigator ? s.navigator.userAgent : n
    }
    function gc() {
        return s.navigator
    }
    cc = bc = ac = $b = p;
    var hc;
    if (hc = fc()) {
        var ic = gc();
        $b = 0 == hc.indexOf("Opera");
        ac = !$b && -1 != hc.indexOf("MSIE");
        bc = !$b && -1 != hc.indexOf("WebKit");
        cc = !$b && !bc && "Gecko" == ic.product
    }
    var jc = $b,
        G = ac,
        kc = cc,
        lc = bc,
        mc = gc(),
        nc = mc && mc.platform || "";
    dc = -1 != nc.indexOf("Mac");
    ec = -1 != nc.indexOf("Win");
    var oc = !! gc() && -1 != (gc().appVersion || "").indexOf("X11");

    function pc() {
        var a = s.document;
        return a ? a.documentMode : h
    }
    var qc;
    a: {
        var rc = "",
            sc;
        if (jc && s.opera) var tc = s.opera.version,
        rc = "function" == typeof tc ? tc() : tc;
        else if (kc ? sc = /rv\:([^\);]+)(\)|;)/ : G ? sc = /MSIE\s+([^\);]+)(\)|;)/ : lc && (sc = /WebKit\/(\S+)/), sc) var uc = sc.exec(fc()),
        rc = uc ? uc[1] : "";
        if (G) {
            var vc = pc();
            if (vc > parseFloat(rc)) {
                qc = String(vc);
                break a
            }
        }
        qc = rc
    }
    var wc = qc,
        xc = {};

    function yc(a) {
        return xc[a] || (xc[a] = 0 <= Ga(wc, a))
    }
    function zc(a) {
        return G && Ac >= a
    }
    var Bc = s.document,
        Ac = !Bc || !G ? h : pc() || ("CSS1Compat" == Bc.compatMode ? parseInt(wc, 10) : 5);
    var Cc, Dc = !G || zc(9),
        Ec = !kc && !G || G && zc(9) || kc && yc("1.9.1"),
        Fc = G && !yc("9"),
        Gc = G || jc || lc;

    function Hc(a) {
        a = a.className;
        return u(a) && a.match(/\S+/g) || []
    }
    function I(a, b) {
        var c = Hc(a),
            d = ab(arguments, 1),
            e = c.length + d.length;
        Ic(c, d);
        a.className = c.join(" ");
        return c.length == e
    }
    function J(a, b) {
        var c = Hc(a),
            d = ab(arguments, 1),
            c = Jc(c, d);
        a.className = c.join(" ")
    }
    function Ic(a, b) {
        for (var c = 0; c < b.length; c++) Sa(a, b[c]) || a.push(b[c])
    }
    function Jc(a, b) {
        return Ma(a, function (a) {
            return !Sa(b, a)
        })
    }

    function Kc(a, b, c) {
        for (var d = Hc(a), e = p, f = 0; f < d.length; f++) d[f] == b && ($a(d, f--, 1), e = m);
        e && (d.push(c), a.className = d.join(" "))
    }
    function Lc(a, b, c) {
        var d = Hc(a);
        u(b) ? Va(d, b) : ga(b) && (d = Jc(d, b));
        u(c) && !Sa(d, c) ? d.push(c) : ga(c) && Ic(d, c);
        a.className = d.join(" ")
    }
    function K(a, b) {
        return Sa(Hc(a), b)
    }
    function Mc(a, b, c) {
        c ? I(a, b) : J(a, b)
    }
    function Nc(a, b) {
        var c = !K(a, b);
        Mc(a, b, c);
        return c
    };

    function Oc(a) {
        return a ? new Pc(Qc(a)) : Cc || (Cc = new Pc)
    }
    function L(a) {
        return u(a) ? document.getElementById(a) : a
    }
    function M(a, b) {
        var c = b || document;
        return c.querySelectorAll && c.querySelector ? c.querySelectorAll("." + a) : c.getElementsByClassName ? c.getElementsByClassName(a) : Rc("*", a, b)
    }
    function N(a, b) {
        var c = b || document,
            d = n;
        return (d = c.querySelectorAll && c.querySelector ? c.querySelector("." + a) : M(a, b)[0]) || n
    }

    function Rc(a, b, c) {
        var d = document;
        c = c || d;
        a = a && "*" != a ? a.toUpperCase() : "";
        if (c.querySelectorAll && c.querySelector && (a || b)) return c.querySelectorAll(a + (b ? "." + b : ""));
        if (b && c.getElementsByClassName) {
            c = c.getElementsByClassName(b);
            if (a) {
                for (var d = {}, e = 0, f = 0, k; k = c[f]; f++) a == k.nodeName && (d[e++] = k);
                d.length = e;
                return d
            }
            return c
        }
        c = c.getElementsByTagName(a || "*");
        if (b) {
            d = {};
            for (f = e = 0; k = c[f]; f++) a = k.className, "function" == typeof a.split && Sa(a.split(/\s+/), b) && (d[e++] = k);
            d.length = e;
            return d
        }
        return c
    }

    function Sc(a, b) {
        fb(b, function (b, d) {
            "style" == d ? a.style.cssText = b : "class" == d ? a.className = b : "for" == d ? a.htmlFor = b : d in Tc ? a.setAttribute(Tc[d], b) : 0 == d.lastIndexOf("aria-", 0) || 0 == d.lastIndexOf("data-", 0) ? a.setAttribute(d, b) : a[d] = b
        })
    }
    var Tc = {
        cellpadding: "cellPadding",
        cellspacing: "cellSpacing",
        colspan: "colSpan",
        frameborder: "frameBorder",
        height: "height",
        maxlength: "maxLength",
        role: "role",
        rowspan: "rowSpan",
        type: "type",
        usemap: "useMap",
        valign: "vAlign",
        width: "width"
    };

    function Uc(a) {
        a = a.document;
        a = Vc(a) ? a.documentElement : a.body;
        return new Zb(a.clientWidth, a.clientHeight)
    }
    function Wc(a) {
        var b = !lc && Vc(a) ? a.documentElement : a.body;
        a = a.parentWindow || a.defaultView;
        return G && yc("10") && a.pageYOffset != b.scrollTop ? new Xb(b.scrollLeft, b.scrollTop) : new Xb(a.pageXOffset || b.scrollLeft, a.pageYOffset || b.scrollTop)
    }
    function Xc(a, b, c) {
        return Yc(document, arguments)
    }

    function Yc(a, b) {
        var c = b[0],
            d = b[1];
        if (!Dc && d && (d.name || d.type)) {
            c = ["<", c];
            d.name && c.push(' name="', va(d.name), '"');
            if (d.type) {
                c.push(' type="', va(d.type), '"');
                var e = {};
                pb(e, d);
                delete e.type;
                d = e
            }
            c.push(">");
            c = c.join("")
        }
        c = a.createElement(c);
        d && (u(d) ? c.className = d : ga(d) ? I.apply(n, [c].concat(d)) : Sc(c, d));
        2 < b.length && Zc(a, c, b, 2);
        return c
    }

    function Zc(a, b, c, d) {
        function e(c) {
            c && b.appendChild(u(c) ? a.createTextNode(c) : c)
        }
        for (; d < c.length; d++) {
            var f = c[d];
            ha(f) && !(ka(f) && 0 < f.nodeType) ? z($c(f) ? Ya(f) : f, e) : e(f)
        }
    }
    function ad(a) {
        var b = document,
            c = b.createElement("div");
        G ? (c.innerHTML = "<br>" + a, c.removeChild(c.firstChild)) : c.innerHTML = a;
        if (1 == c.childNodes.length) return c.removeChild(c.firstChild);
        for (a = b.createDocumentFragment(); c.firstChild;) a.appendChild(c.firstChild);
        return a
    }
    function Vc(a) {
        return "CSS1Compat" == a.compatMode
    }

    function bd(a, b) {
        Zc(Qc(a), a, arguments, 1)
    }
    function cd(a) {
        for (var b; b = a.firstChild;) a.removeChild(b)
    }
    function dd(a, b) {
        b.parentNode && b.parentNode.insertBefore(a, b)
    }
    function ed(a, b) {
        a.insertBefore(b, a.childNodes[0] || n)
    }
    function fd(a) {
        return a && a.parentNode ? a.parentNode.removeChild(a) : n
    }
    function gd() {
        var a = hd,
            b = id,
            c = b.parentNode;
        c && c.replaceChild(a, b)
    }
    function jd(a) {
        return Ec && a.children != h ? a.children : Ma(a.childNodes, function (a) {
            return 1 == a.nodeType
        })
    }

    function kd(a) {
        return a.firstElementChild != h ? a.firstElementChild : ld(a.firstChild, m)
    }
    function ld(a, b) {
        for (; a && 1 != a.nodeType;) a = b ? a.nextSibling : a.previousSibling;
        return a
    }
    function md(a) {
        if (!a) return n;
        if (a.firstChild) return a.firstChild;
        for (; a && !a.nextSibling;) a = a.parentNode;
        return a ? a.nextSibling : n
    }
    function nd(a) {
        if (!a) return n;
        if (!a.previousSibling) return a.parentNode;
        for (a = a.previousSibling; a && a.lastChild;) a = a.lastChild;
        return a
    }

    function od(a, b) {
        if (a.contains && 1 == b.nodeType) return a == b || a.contains(b);
        if ("undefined" != typeof a.compareDocumentPosition) return a == b || Boolean(a.compareDocumentPosition(b) & 16);
        for (; b && a != b;) b = b.parentNode;
        return b == a
    }
    function Qc(a) {
        return 9 == a.nodeType ? a : a.ownerDocument || a.document
    }

    function pd(a, b) {
        if ("textContent" in a) a.textContent = b;
        else if (a.firstChild && 3 == a.firstChild.nodeType) {
            for (; a.lastChild != a.firstChild;) a.removeChild(a.lastChild);
            a.firstChild.data = b
        } else cd(a), a.appendChild(Qc(a).createTextNode(String(b)))
    }
    function qd(a, b) {
        var c = [];
        return rd(a, b, c, m) ? c[0] : h
    }
    function rd(a, b, c, d) {
        if (a != n) for (a = a.firstChild; a;) {
                if (b(a) && (c.push(a), d) || rd(a, b, c, d)) return m;
                a = a.nextSibling
        }
        return p
    }
    var sd = {
        SCRIPT: 1,
        STYLE: 1,
        HEAD: 1,
        IFRAME: 1,
        OBJECT: 1
    }, td = {
            IMG: " ",
            BR: "\n"
        };

    function ud(a) {
        if (Fc && "innerText" in a) a = a.innerText.replace(/(\r\n|\r|\n)/g, "\n");
        else {
            var b = [];
            vd(a, b, m);
            a = b.join("")
        }
        a = a.replace(/ \xAD /g, " ").replace(/\xAD/g, "");
        a = a.replace(/\u200B/g, "");
        Fc || (a = a.replace(/ +/g, " "));
        " " != a && (a = a.replace(/^\s*/, ""));
        return a
    }

    function vd(a, b, c) {
        if (!(a.nodeName in sd)) if (3 == a.nodeType) c ? b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g, "")) : b.push(a.nodeValue);
            else if (a.nodeName in td) b.push(td[a.nodeName]);
        else for (a = a.firstChild; a;) vd(a, b, c), a = a.nextSibling
    }
    function $c(a) {
        if (a && "number" == typeof a.length) {
            if (ka(a)) return "function" == typeof a.item || "string" == typeof a.item;
            if (ja(a)) return "function" == typeof a.item
        }
        return p
    }

    function wd(a, b, c) {
        if (!b && !c) return n;
        var d = b ? b.toUpperCase() : n;
        return xd(a, function (a) {
            return (!d || a.nodeName == d) && (!c || K(a, c))
        }, m)
    }
    function Q(a, b) {
        return wd(a, n, b)
    }
    function xd(a, b, c, d) {
        c || (a = a.parentNode);
        c = d == n;
        for (var e = 0; a && (c || e <= d);) {
            if (b(a)) return a;
            a = a.parentNode;
            e++
        }
        return n
    }
    function Pc(a) {
        this.b = a || s.document || document
    }
    r = Pc.prototype;
    r.H = function (a) {
        return u(a) ? this.b.getElementById(a) : a
    };
    r.ji = function (a, b, c) {
        return Yc(this.b, arguments)
    };
    r.createElement = function (a) {
        return this.b.createElement(a)
    };

    function yd(a) {
        return Vc(a.b)
    }
    function zd(a) {
        return Wc(a.b)
    }
    r.appendChild = function (a, b) {
        a.appendChild(b)
    };
    r.getChildren = jd;
    r.contains = od;
    var Ad = "StopIteration" in s ? s.StopIteration : Error("StopIteration");

    function Bd() {}
    Bd.prototype.b = function () {
        g(Ad)
    };
    Bd.prototype.gb = function () {
        return this
    };

    function Cd(a) {
        if (a instanceof Bd) return a;
        if ("function" == typeof a.gb) return a.gb(p);
        if (ha(a)) {
            var b = 0,
                c = new Bd;
            c.b = function () {
                for (;;) {
                    b >= a.length && g(Ad);
                    if (b in a) return a[b++];
                    b++
                }
            };
            return c
        }
        g(Error("Not implemented"))
    }

    function Dd(a, b) {
        if (ha(a)) try {
                z(a, b, h)
        } catch (c) {
            c !== Ad && g(c)
        } else {
            a = Cd(a);
            try {
                for (;;) b.call(h, a.b(), h, a)
            } catch (d) {
                d !== Ad && g(d)
            }
        }
    }
    function Ed(a) {
        if (ha(a)) return Ya(a);
        a = Cd(a);
        var b = [];
        Dd(a, function (a) {
            b.push(a)
        });
        return b
    };

    function Fd(a) {
        if ("function" == typeof a.ya) return a.ya();
        if (u(a)) return a.split("");
        if (ha(a)) {
            for (var b = [], c = a.length, d = 0; d < c; d++) b.push(a[d]);
            return b
        }
        return hb(a)
    }
    function Gd(a, b, c) {
        if ("function" == typeof a.forEach) a.forEach(b, c);
        else if (ha(a) || u(a)) z(a, b, c);
        else {
            var d;
            if ("function" == typeof a.Ma) d = a.Ma();
            else if ("function" != typeof a.ya) if (ha(a) || u(a)) {
                    d = [];
                    for (var e = a.length, f = 0; f < e; f++) d.push(f)
                } else d = ib(a);
                else d = h;
            for (var e = Fd(a), f = e.length, k = 0; k < f; k++) b.call(c, e[k], d && d[k], a)
        }
    };

    function Hd(a, b) {
        this.e = {};
        this.b = [];
        var c = arguments.length;
        if (1 < c) {
            c % 2 && g(Error("Uneven number of arguments"));
            for (var d = 0; d < c; d += 2) this.set(arguments[d], arguments[d + 1])
        } else if (a) {
            a instanceof Hd ? (c = a.Ma(), d = a.ya()) : (c = ib(a), d = hb(a));
            for (var e = 0; e < c.length; e++) this.set(c[e], d[e])
        }
    }
    r = Hd.prototype;
    r.J = 0;
    r.Sb = 0;
    r.nb = function () {
        return this.J
    };
    r.ya = function () {
        Id(this);
        for (var a = [], b = 0; b < this.b.length; b++) a.push(this.e[this.b[b]]);
        return a
    };
    r.Ma = function () {
        Id(this);
        return this.b.concat()
    };
    r.clear = function () {
        this.e = {};
        this.Sb = this.J = this.b.length = 0
    };
    r.remove = function (a) {
        return Jd(this.e, a) ? (delete this.e[a], this.J--, this.Sb++, this.b.length > 2 * this.J && Id(this), m) : p
    };

    function Id(a) {
        if (a.J != a.b.length) {
            for (var b = 0, c = 0; b < a.b.length;) {
                var d = a.b[b];
                Jd(a.e, d) && (a.b[c++] = d);
                b++
            }
            a.b.length = c
        }
        if (a.J != a.b.length) {
            for (var e = {}, c = b = 0; b < a.b.length;) d = a.b[b], Jd(e, d) || (a.b[c++] = d, e[d] = 1), b++;
            a.b.length = c
        }
    }
    r.get = function (a, b) {
        return Jd(this.e, a) ? this.e[a] : b
    };
    r.set = function (a, b) {
        Jd(this.e, a) || (this.J++, this.b.push(a), this.Sb++);
        this.e[a] = b
    };
    r.N = function () {
        return new Hd(this)
    };
    r.gb = function (a) {
        Id(this);
        var b = 0,
            c = this.b,
            d = this.e,
            e = this.Sb,
            f = this,
            k = new Bd;
        k.b = function () {
            for (;;) {
                e != f.Sb && g(Error("The map has changed since the iterator was created"));
                b >= c.length && g(Ad);
                var k = c[b++];
                return a ? k : d[k]
            }
        };
        return k
    };

    function Jd(a, b) {
        return Object.prototype.hasOwnProperty.call(a, b)
    };

    function Kd(a) {
        var b = [];
        Ld(a, b, Md);
        return b.join("&")
    }

    function Ld(a, b, c) {
        for (var d = a.elements, e, f = 0; e = d[f]; f++) if (!(e.form != a || e.disabled || "fieldset" == e.tagName.toLowerCase())) {
                var k = e.name;
                switch (e.type.toLowerCase()) {
                    case "file":
                    case "submit":
                    case "reset":
                    case "button":
                        break;
                    case "select-multiple":
                        e = Nd(e);
                        if (e != n) for (var l, q = 0; l = e[q]; q++) c(b, k, l);
                        break;
                    default:
                        l = Nd(e), l != n && c(b, k, l)
                }
            }
        d = a.getElementsByTagName("input");
        for (f = 0; e = d[f]; f++) e.form == a && "image" == e.type.toLowerCase() && (k = e.name, c(b, k, e.value), c(b, k + ".x", "0"), c(b, k + ".y", "0"))
    }

    function Od(a, b, c) {
        var d = a.get(b);
        d || (d = [], a.set(b, d));
        d.push(c)
    }
    function Md(a, b, c) {
        a.push(encodeURIComponent(b) + "=" + encodeURIComponent(c))
    }
    function Nd(a) {
        var b = a.type;
        if (!fa(b)) return n;
        switch (b.toLowerCase()) {
            case "checkbox":
            case "radio":
                return a.checked ? a.value : n;
            case "select-one":
                return b = a.selectedIndex, 0 <= b ? a.options[b].value : n;
            case "select-multiple":
                for (var b = [], c, d = 0; c = a.options[d]; d++) c.selected && b.push(c.value);
                return b.length ? b : n;
            default:
                return fa(a.value) ? a.value : n
        }
    };

    function Pd(a) {
        a = String(a);
        if (/^\s*$/.test(a) ? 0 : /^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g, "@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g, ""))) try {
                return eval("(" + a + ")")
        } catch (b) {}
        g(Error("Invalid JSON string: " + a))
    }
    function Qd(a) {
        return eval("(" + a + ")")
    }
    function Rd(a) {
        return Sd(new Td(h), a)
    }
    function Td(a) {
        this.b = a
    }

    function Sd(a, b) {
        var c = [];
        Ud(a, b, c);
        return c.join("")
    }

    function Ud(a, b, c) {
        switch (typeof b) {
            case "string":
                Vd(b, c);
                break;
            case "number":
                c.push(isFinite(b) && !isNaN(b) ? b : "null");
                break;
            case "boolean":
                c.push(b);
                break;
            case "undefined":
                c.push("null");
                break;
            case "object":
                if (b == n) {
                    c.push("null");
                    break
                }
                if (ga(b)) {
                    var d = b.length;
                    c.push("[");
                    for (var e = "", f = 0; f < d; f++) c.push(e), e = b[f], Ud(a, a.b ? a.b.call(b, String(f), e) : e, c), e = ",";
                    c.push("]");
                    break
                }
                c.push("{");
                d = "";
                for (f in b) Object.prototype.hasOwnProperty.call(b, f) && (e = b[f], "function" != typeof e && (c.push(d), Vd(f, c), c.push(":"),
                        Ud(a, a.b ? a.b.call(b, f, e) : e, c), d = ","));
                c.push("}");
                break;
            case "function":
                break;
            default:
                g(Error("Unknown type: " + typeof b))
        }
    }
    var Wd = {
        '"': '\\"',
        "\\": "\\\\",
        "/": "\\/",
        "\b": "\\b",
        "\f": "\\f",
        "\n": "\\n",
        "\r": "\\r",
        "\t": "\\t",
        "\x0B": "\\u000b"
    }, Xd = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g;

    function Vd(a, b) {
        b.push('"', a.replace(Xd, function (a) {
            if (a in Wd) return Wd[a];
            var b = a.charCodeAt(0),
                e = "\\u";
            16 > b ? e += "000" : 256 > b ? e += "00" : 4096 > b && (e += "0");
            return Wd[a] = e + b.toString(16)
        }), '"')
    };

    function Yd() {
        this.b = w()
    }
    new Yd;
    Yd.prototype.set = function (a) {
        this.b = a
    };
    Yd.prototype.get = function () {
        return this.b
    };

    function Zd(a) {
        return $d(a || arguments.callee.caller, [])
    }

    function $d(a, b) {
        var c = [];
        if (Sa(b, a)) c.push("[...circular reference...]");
        else if (a && 50 > b.length) {
            c.push(ae(a) + "(");
            for (var d = a.arguments, e = 0; e < d.length; e++) {
                0 < e && c.push(", ");
                var f;
                f = d[e];
                switch (typeof f) {
                    case "object":
                        f = f ? "object" : "null";
                        break;
                    case "string":
                        break;
                    case "number":
                        f = String(f);
                        break;
                    case "boolean":
                        f = f ? "true" : "false";
                        break;
                    case "function":
                        f = (f = ae(f)) ? f : "[fn]";
                        break;
                    default:
                        f = typeof f
                }
                40 < f.length && (f = f.substr(0, 40) + "...");
                c.push(f)
            }
            b.push(a);
            c.push(")\n");
            try {
                c.push($d(a.caller, b))
            } catch (k) {
                c.push("[exception trying to get caller]\n")
            }
        } else a ?
                c.push("[...long stack...]") : c.push("[end]");
        return c.join("")
    }
    function ae(a) {
        if (be[a]) return be[a];
        a = String(a);
        if (!be[a]) {
            var b = /function ([^\(]+)/.exec(a);
            be[a] = b ? b[1] : "[Anonymous]"
        }
        return be[a]
    }
    var be = {};

    function ce(a, b, c, d, e) {
        "number" == typeof e || de++;
        d || w();
        this.g = b;
        delete this.e;
        delete this.b
    }
    ce.prototype.e = n;
    ce.prototype.b = n;
    var de = 0;
    ce.prototype.getMessage = function () {
        return this.g
    };

    function ee() {}
    ee.prototype.b = n;
    ee.prototype.g = n;
    ee.prototype.e = n;

    function fe(a, b) {
        this.name = a;
        this.value = b
    }
    fe.prototype.toString = function () {
        return this.name
    };
    var ge = new fe("SEVERE", 1E3),
        he = new fe("WARNING", 900),
        ie = new fe("INFO", 800),
        je = new fe("CONFIG", 700),
        ke = new fe("FINE", 500);
    ee.prototype.getChildren = function () {
        this.e || (this.e = {});
        return this.e
    };

    function le(a) {
        return a.g ? a.g : a.b ? le(a.b) : n
    }
    ee.prototype.log = function (a, b, c) {
        if (a.value >= le(this).value) {
            a = "log:" + this.i(a, b, c).getMessage();
            s.console && (s.console.timeStamp ? s.console.timeStamp(a) : s.console.markTimeline && s.console.markTimeline(a));
            s.msWriteProfilerMark && s.msWriteProfilerMark(a);
            for (a = this; a;) a = a.b
        }
    };
    ee.prototype.i = function (a, b, c) {
        var d = new ce(0, String(b));
        if (c) {
            d.e = c;
            var e;
            var f = arguments.callee.caller;
            try {
                var k;
                var l = t("window.location.href");
                if (u(c)) k = {
                        message: c,
                        name: "Unknown error",
                        lineNumber: "Not available",
                        fileName: l,
                        stack: "Not available"
                };
                else {
                    var q, A, H = p;
                    try {
                        q = c.lineNumber || c.ni || "Not available"
                    } catch (O) {
                        q = "Not available", H = m
                    }
                    try {
                        A = c.fileName || c.filename || c.sourceURL || s.$googDebugFname || l
                    } catch (P) {
                        A = "Not available", H = m
                    }
                    k = H || !c.lineNumber || !c.fileName || !c.stack ? {
                        message: c.message,
                        name: c.name,
                        lineNumber: q,
                        fileName: A,
                        stack: c.stack || "Not available"
                    } : c
                }
                e = "Message: " + va(k.message) + '\nUrl: <a href="view-source:' + k.fileName + '" target="_new">' + k.fileName + "</a>\nLine: " + k.lineNumber + "\n\nBrowser stack:\n" + va(k.stack + "-> ") + "[end]\n\nJS stack traversal:\n" + va(Zd(f) + "-> ")
            } catch (ba) {
                e = "Exception trying to expose exception! You win, we lose. " + ba
            }
            d.b = e
        }
        return d
    };
    ee.prototype.info = function (a, b) {
        this.log(ie, a, b)
    };

    function me(a, b) {
        a.log(ke, b, h)
    }
    var ne = {}, oe = n;

    function pe(a) {
        oe || (oe = new ee, ne[""] = oe, oe.g = je);
        var b;
        if (!(b = ne[a])) {
            b = new ee;
            var c = a.lastIndexOf("."),
                d = a.substr(c + 1),
                c = pe(a.substr(0, c));
            c.getChildren()[d] = b;
            b.b = c;
            ne[a] = b
        }
        return b
    };

    function qe(a, b, c, d, e, f, k) {
        var l = "";
        a && (l += a + ":");
        c && (l += "//", b && (l += b + "@"), l += c, d && (l += ":" + d));
        e && (l += e);
        f && (l += "?" + f);
        k && (l += "#" + k);
        return l
    }
    var re = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");

    function se(a) {
        if (te) {
            te = p;
            var b = s.location;
            if (b) {
                var c = b.href;
                if (c && (c = ue(c)) && c != b.hostname) te = m, g(Error())
            }
        }
        return a.match(re)
    }
    var te = lc;

    function ue(a) {
        return (a = se(a)[3] || n) && decodeURIComponent(a)
    }

    function ve() {
        var a = se(document.location.href);
        return qe(a[1], a[2], a[3], a[4])
    }
    function we(a) {
        a = se(a);
        return qe(n, n, n, n, a[5], a[6], a[7])
    }
    function xe(a) {
        var b = a.indexOf("#");
        return 0 > b ? a : a.substr(0, b)
    }
    function ye(a) {
        if (a[1]) {
            var b = a[0],
                c = b.indexOf("#");
            0 <= c && (a.push(b.substr(c)), a[0] = b = b.substr(0, c));
            c = b.indexOf("?");
            0 > c ? a[1] = "?" : c == b.length - 1 && (a[1] = h)
        }
        return a.join("")
    }

    function ze(a, b, c) {
        if (ga(b)) for (var d = 0; d < b.length; d++) ze(a, String(b[d]), c);
        else b != n && c.push("&", a, "" === b ? "" : "=", encodeURIComponent(String(b)))
    }
    function Ae(a, b, c) {
        Math.max(b.length - (c || 0), 0);
        for (c = c || 0; c < b.length; c += 2) ze(b[c], b[c + 1], a);
        return a
    }
    function Be(a, b) {
        for (var c in b) ze(c, b[c], a);
        return a
    }
    function Ce(a, b) {
        return ye(2 == arguments.length ? Ae([a], arguments[1], 0) : Ae([a], arguments, 1))
    }
    var De = /#|$/;

    function Ee(a, b) {
        var c = a.search(De),
            d;
        a: {
            d = 0;
            for (var e = b.length; 0 <= (d = a.indexOf(b, d)) && d < c;) {
                var f = a.charCodeAt(d - 1);
                if (38 == f || 63 == f) if (f = a.charCodeAt(d + e), !f || 61 == f || 38 == f || 35 == f) break a;
                d += e + 1
            }
            d = -1
        }
        if (0 > d) return n;
        e = a.indexOf("&", d);
        if (0 > e || e > c) e = c;
        d += b.length + 1;
        return ua(a.substr(d, e - d))
    };

    function Fe(a) {
        "?" == a.charAt(0) && (a = a.substr(1));
        a = a.split("&");
        for (var b = {}, c = 0, d = a.length; c < d; c++) {
            var e = a[c].split("=");
            if (1 == e.length && e[0] || 2 == e.length) {
                var f = ua(e[0] || ""),
                    e = ua(e[1] || "");
                f in b ? ga(b[f]) ? Za(b[f], e) : b[f] = [b[f], e] : b[f] = e
            }
        }
        return b
    }
    function Ge(a) {
        "#" == a.charAt(0) && (a = "!" == a.charAt(1) ? a.substr(2) : a.substr(1));
        return Fe(a)
    }
    function He(a) {
        a = Be([], a);
        a[0] = "";
        return a.join("")
    }
    function Ie(a, b) {
        return ye(Be([a], b))
    }
    var Je = ue;

    function Ke(a, b) {
        var c = a.split("?", 2);
        a = c[0];
        var c = Fe(c[1] || ""),
            d;
        for (d in b) c[d] = b[d];
        return Ie(a, c)
    }
    function Le(a, b) {
        var c = "";
        "#" == a.charAt(0) && (c = "!" == a.charAt(1) ? a.substr(0, 2) : a.substr(0, 1));
        var d = Ge(a),
            e;
        for (e in b) d[e] = b[e];
        return c + He(d)
    }
    function Me(a) {
        a = Je(a);
        a = a === n ? n : a.split(".").reverse();
        return (a === n ? p : "com" == a[0] && a[1].match(/^youtube(?:-nocookie)?$/) ? m : p) || (a === n ? p : "google" == a[1] ? m : "google" == a[2] ? "au" == a[0] && "com" == a[1] ? m : "uk" == a[0] && "co" == a[1] ? m : p : p)
    };
    var Ne = n;
    "undefined" != typeof XMLHttpRequest ? Ne = function () {
        return new XMLHttpRequest
    } : "undefined" != typeof ActiveXObject && (Ne = function () {
        return new ActiveXObject("Microsoft.XMLHTTP")
    });

    function Oe(a) {
        switch (a && "status" in a ? a.status : -1) {
            case 0:
            case 200:
            case 204:
            case 304:
                return m;
            default:
                return p
        }
    };

    function Pe(a, b, c, d, e, f, k) {
        var l = Ne && Ne();
        if ("open" in l) {
            l.onreadystatechange = function () {
                4 == (l && "readyState" in l ? l.readyState : 0) && b && b(l)
            };
            c = (c || "GET").toUpperCase();
            d = d || "";
            l.open(c, a, m);
            f && (l.responseType = f);
            k && (l.withCredentials = m);
            a = "POST" == c;
            if (e) for (var q in e) l.setRequestHeader(q, e[q]), "content-type" == q.toLowerCase() && (a = p);
            a && l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            l.send(d);
            return l
        }
    }

    function R(a, b) {
        var c = b.format || "JSON";
        b.He && (a = document.location.protocol + "//" + document.location.hostname + (document.location.port ? ":" + document.location.port : "") + a);
        var d = b.G;
        d && (a = Ke(a, d));
        var e = b.Wd || "";
        if (d = b.F) e = Fe(e), pb(e, d), e = He(e);
        var f = p,
            k, l = Pe(a, function (a) {
                if (!f) {
                    f = m;
                    k && Qb(k);
                    var d = Oe(a),
                        e = n;
                    if (d || 400 <= a.status && 500 > a.status) e = Qe(c, a);
                    if (d) a: {
                            switch (c) {
                                case "XML":
                                    d = 0 == parseInt(e && e.return_code, 10);
                                    break a;
                                case "RAW":
                                    d = m;
                                    break a
                            }
                            d = !! e
                    }
                    var e = e || {}, l = b.R || s;
                    d ? b.B && b.B.call(l, a, e) : b.onError &&
                        b.onError.call(l, a, e);
                    b.da && b.da.call(l, a, e)
                }
            }, b.method, e, b.headers, b.responseType, b.withCredentials);
        b.gh && 0 < b.timeout && (k = D(function () {
            f || (f = m, l.abort(), Qb(k), b.gh.call(b.R || s, l))
        }, b.timeout));
        return l
    }
    function Re(a, b) {
        var c = b || {};
        c.method = a.method.toUpperCase();
        if ("POST" == c.method) c.Wd = Kd(a);
        else {
            var d = new Hd;
            Ld(a, d, Od);
            Id(d);
            for (var e = {}, f = 0; f < d.b.length; f++) {
                var k = d.b[f];
                e[k] = d.e[k]
            }
            d = c.G || {};
            pb(d, e);
            c.G = d
        }
        R(a.action, c)
    }

    function Qe(a, b) {
        var c = n;
        switch (a) {
            case "JSON":
                var d = b.responseText,
                    e = b.getResponseHeader("Content-Type") || "";
                d && 0 <= e.indexOf("json") && (c = Qd(d));
                break;
            case "XML":
                if (d = (d = b.responseXML) ? Se(d) : n) c = {}, z(d.getElementsByTagName("*"), function (a) {
                        c[a.tagName] = Te(a)
                    })
        }
        return c
    }

    function Ue(a, b) {
        var c = b.onComplete || n,
            d = b.onException || n,
            e = b.onError || n,
            f = b.update || n,
            k = b.json || p;
        Pe(a, function (a) {
            if (Oe(a)) {
                var b = a.responseXML,
                    A = b ? Se(b) : n,
                    b = !(!b || !A),
                    H, O;
                if (b && (H = Ve(A, "return_code"), O = Ve(A, "html_content"), 0 == H)) {
                    f && O && (L(f).innerHTML = O);
                    var P = Ve(A, "js_content");
                    if (P) {
                        var ba = document.createElement("script");
                        ba.text = P;
                        document.getElementsByTagName("head")[0].appendChild(ba)
                    }
                }
                c && (b ? (b = Ve(A, "redirect_on_success"), H && b ? window.location = b : ((A = Ve(A, 0 == H ? "success_message" : "error_message")) &&
                    alert(A), a = k ? eval("(" + O + ")") : a, 0 == H ? c(a) : d && d(a))) : a.responseText && c(a))
            } else e && e(a)
        }, b.method || "POST", b.postBody || n, b.headers || n)
    }
    function Se(a) {
        return !a ? n : (a = ("responseXML" in a ? a.responseXML : a).getElementsByTagName("root")) && 0 < a.length ? a[0] : n
    }
    function Ve(a, b) {
        if (!a) return n;
        var c = a.getElementsByTagName(b);
        return c && 0 < c.length ? Te(c[0]) : n
    }
    function Te(a) {
        var b = "";
        z(a.childNodes, function (a) {
            b += a.nodeValue
        });
        return b
    }
    var We = {
        html5_ajax: "action_get_html5_token",
        watch_actions_ajax: "action_get_watch_actions_token",
        addto_ajax: "action_get_wl_token"
    }, Xe = {
            html5_ajax: "html5_ajax_token",
            watch_actions_ajax: "watch_actions_ajax_token",
            addto_ajax: "addto_ajax_token"
        };

    function Ye(a, b) {
        if (C("watch_actions_ajax")) a && window.setTimeout(a, 0);
        else {
            var c = ve() + "/token_ajax",
                d = {};
            d[We.watch_actions_ajax] = 1;
            R(c, {
                format: "RAW",
                method: "GET",
                G: d,
                da: function (c) {
                    var d = Fe(c.responseText),
                        k = d[Xe.watch_actions_ajax];
                    k ? (Ob("watch_actions_ajax", k), a && a()) : b && b(c, d)
                }
            })
        }
    };

    function Ze() {
        var a = L("facebook_token_refresh_iframe");
        a && (a.src = B("FACEBOOK_TOKEN_REFRESH_URL"))
    };

    function $e() {};

    function af() {}
    y(af, $e);
    af.prototype.nb = function () {
        var a = 0;
        Dd(this.gb(m), function () {
            a++
        });
        return a
    };
    af.prototype.clear = function () {
        var a = Ed(this.gb(m)),
            b = this;
        z(a, function (a) {
            b.remove(a)
        })
    };

    function bf(a) {
        this.b = a
    }
    y(bf, af);

    function cf(a) {
        if (!a.b) return p;
        try {
            return a.b.setItem("__sak", "1"), a.b.removeItem("__sak"), m
        } catch (b) {
            return p
        }
    }
    r = bf.prototype;
    r.set = function (a, b) {
        try {
            this.b.setItem(a, b)
        } catch (c) {
            0 == this.b.length && g("Storage mechanism: Storage disabled"), g("Storage mechanism: Quota exceeded")
        }
    };
    r.get = function (a) {
        a = this.b.getItem(a);
        !u(a) && a !== n && g("Storage mechanism: Invalid value was encountered");
        return a
    };
    r.remove = function (a) {
        this.b.removeItem(a)
    };
    r.nb = function () {
        return this.b.length
    };
    r.gb = function (a) {
        var b = 0,
            c = this.b,
            d = new Bd;
        d.b = function () {
            b >= c.length && g(Ad);
            var d;
            d = c.key(b++);
            if (a) return d;
            d = c.getItem(d);
            u(d) || g("Storage mechanism: Invalid value was encountered");
            return d
        };
        return d
    };
    r.clear = function () {
        this.b.clear()
    };
    r.key = function (a) {
        return this.b.key(a)
    };

    function df() {
        var a = n;
        try {
            a = window.localStorage || n
        } catch (b) {}
        this.b = a
    }
    y(df, bf);

    function ef() {
        var a = n;
        try {
            a = window.sessionStorage || n
        } catch (b) {}
        this.b = a
    }
    y(ef, bf);

    function ff(a) {
        this.Pa = a;
        this.Re = new Td
    }
    r = ff.prototype;
    r.Pa = n;
    r.Re = n;
    r.set = function (a, b) {
        fa(b) ? this.Pa.set(a, Sd(this.Re, b)) : this.Pa.remove(a)
    };
    r.get = function (a) {
        a = this.Pa.get(a);
        if (a !== n) try {
                return Pd(a)
        } catch (b) {
            g("Storage: Invalid value was encountered")
        }
    };
    r.remove = function (a) {
        this.Pa.remove(a)
    };

    function gf(a) {
        ff.call(this, a)
    }
    y(gf, ff);

    function hf(a) {
        this.data = a
    }
    function jf(a) {
        return !fa(a) || a instanceof hf ? a : new hf(a)
    }
    gf.prototype.set = function (a, b) {
        gf.L.set.call(this, a, jf(b))
    };
    gf.prototype.b = function (a) {
        a = gf.L.get.call(this, a);
        if (!fa(a) || a instanceof Object) return a;
        g("Storage: Invalid value was encountered")
    };
    gf.prototype.get = function (a) {
        (a = this.b(a)) ? (a = a.data, fa(a) || g("Storage: Invalid value was encountered")) : a = h;
        return a
    };

    function kf(a) {
        ff.call(this, a)
    }
    y(kf, gf);

    function lf(a) {
        var b = a.creation;
        a = a.expiration;
        return !!a && a < w() || !! b && b > w()
    }
    kf.prototype.set = function (a, b, c) {
        if (b = jf(b)) {
            if (c) {
                if (c < w()) {
                    kf.prototype.remove.call(this, a);
                    return
                }
                b.expiration = c
            }
            b.creation = w()
        }
        kf.L.set.call(this, a, b)
    };
    kf.prototype.b = function (a, b) {
        var c = kf.L.b.call(this, a);
        if (c) if (!b && lf(c)) kf.prototype.remove.call(this, a);
            else return c
    };

    function mf(a) {
        ff.call(this, a)
    }
    y(mf, kf);

    function nf() {
        var a = of,
            b = [];
        Dd(a.Pa.gb(m), function (c) {
            var d;
            try {
                d = mf.prototype.b.call(a, c, m)
            } catch (e) {
                if ("Storage: Invalid value was encountered" == e) return;
                g(e)
            }
            lf(d) && b.push(c)
        });
        z(b, function (b) {
            mf.prototype.remove.call(a, b)
        })
    };

    function pf(a, b, c) {
        var d = c && 0 < c ? c : 0;
        c = d ? w() + 1E3 * d : 0;
        if (d = d ? of : qf) {
            u(b) || (b = JSON.stringify(b, h));
            try {
                d.set(a, b, c)
            } catch (e) {
                d.remove(a)
            }
        }
    }
    function rf(a, b) {
        if (!qf && !of) return n;
        var c;
        try {
            c = qf.get(a), c = u(c) ? c : of.get(a)
        } catch (d) {
            return n
        }
        if (!u(c)) return n;
        try {
            c = JSON.parse(c, b)
        } catch (e) {}
        return c
    }
    function sf() {
        of && nf()
    }
    var of = new mf(new df);
    cf(of.Pa) || (of = n);
    var qf = new mf(new ef);
    cf(qf.Pa) || (qf = n);
    var tf = {}, uf = 0;

    function vf(a, b) {
        if (a) {
            var c = new Image,
                d = "" + uf++;
            tf[d] = c;
            c.onload = c.onerror = function () {
                b && tf[d] && b();
                delete tf[d]
            };
            c.src = a;
            c = eval("null")
        }
    };

    function wf(a) {
        var b = B("CONVERSION_CONFIG_DICT");
        if (b) {
            var c = "followon_" + a;
            if (!b.baseUrl || !b.uid) a = n;
            else {
                var d = b.rmktEnabled,
                    e = b.focEnabled && !b.isAd;
                if (!d && !e) a = n;
                else {
                    c = {
                        label: e ? c : "default"
                    };
                    if (d) {
                        d = {
                            utuid: b.uid,
                            type: a
                        };
                        b.vid && (d.utvid = b.vid);
                        b.eventLabel && (d.el = b.eventLabel);
                        b.playerStyle && (d.ps = b.playerStyle);
                        b.feature && (d.feature = b.feature);
                        b.ppe && (d.ppe = b.ppe);
                        var f = [],
                            k;
                        for (k in d) f.push(encodeURIComponent(k) + "=" + encodeURIComponent(d[k]));
                        c.data = f.join(";")
                    }
                    if (e && "view" == a && b.vid && b.uid && (b.oeid ||
                        b.ieid)) b.oeid && (c.oeid = b.oeid), b.ieid && (c.ieid = b.ieid), c.evid = b.vid;
                    e && (c.foc_id = b.uid);
                    a = Ie(b.baseUrl, c)
                }
            }
            a && vf(a)
        }
    };

    function xf(a) {
        a = rf("aid-" + a);
        return !ka(a) ? n : a
    }
    function yf() {
        var a = window.location.hash;
        if (!a || 5 > a.length) return n;
        a = Ge(a).aid;
        return u(a) ? a : n
    }
    function zf(a) {
        var b = {};
        b.aid = a;
        window.location.hash = Le(window.location.hash, b)
    }
    function Af(a, b, c) {
        if (!a) return n;
        b = {
            aid: a.aid || "!aid",
            foc_id: a.channel || "!foc_id",
            label: "followon_" + (b || "view"),
            origin: a.origin || "SHARE"
        };
        a.saw_ad && (b.saw_ad = "1");
        c && (b.agcid = c);
        return Ie("http://www.gstatic.com/youtube/followonevent/l", b)
    };
    var Bf = {};

    function Cf(a, b) {
        if (B("EVENTS_TRACKER_INSTALLED")) {
            var c = Bf[a];
            if (!c) {
                var d = window._gaq._getAsyncTracker("eventsPageTracker");
                if (!d) return;
                window._gaq.push(function () {
                    c = d._createEventTracker(a);
                    Bf[a] = c
                })
            }
            window._gaq.push(function () {
                c._trackEvent(b, h, h)
            })
        }
    };

    function Df(a, b, c) {
        Cf(a, b || "null");
        a = "a=" + a + (b ? "&" + b : "").replace(/\//g, "&");
        vf("/gen_204?" + a, c)
    }
    function Ef() {
        var a = "CSS1Compat" == document.compatMode ? document.documentElement : document.body,
            a = {
                a: "resolution",
                width: screen.width,
                height: screen.height,
                depth: screen.colorDepth,
                win_width: a.clientWidth,
                win_height: a.clientHeight
            };
        window.devicePixelRatio && (a.pixel_ratio = window.devicePixelRatio);
        a = He(a);
        vf("/gen_204?" + a, h)
    }

    function Ff(a, b, c, d) {
        a = {
            name: a,
            locale: c,
            feature: d
        };
        for (var e in b) a[e] = b[e];
        b = Ie("/sharing_services", a);
        vf(b)
    }
    function Gf(a, b, c, d) {
        Ff(a, {
            v: b
        }, c, d)
    };

    function Hf(a, b, c, d) {
        this.top = a;
        this.right = b;
        this.bottom = c;
        this.left = d
    }
    r = Hf.prototype;
    r.N = function () {
        return new Hf(this.top, this.right, this.bottom, this.left)
    };
    r.contains = function (a) {
        return !this || !a ? p : a instanceof Hf ? a.left >= this.left && a.right <= this.right && a.top >= this.top && a.bottom <= this.bottom : a.x >= this.left && a.x <= this.right && a.y >= this.top && a.y <= this.bottom
    };
    r.ceil = function () {
        this.top = Math.ceil(this.top);
        this.right = Math.ceil(this.right);
        this.bottom = Math.ceil(this.bottom);
        this.left = Math.ceil(this.left);
        return this
    };
    r.floor = function () {
        this.top = Math.floor(this.top);
        this.right = Math.floor(this.right);
        this.bottom = Math.floor(this.bottom);
        this.left = Math.floor(this.left);
        return this
    };
    r.round = function () {
        this.top = Math.round(this.top);
        this.right = Math.round(this.right);
        this.bottom = Math.round(this.bottom);
        this.left = Math.round(this.left);
        return this
    };
    r.scale = function (a, b) {
        var c = ia(b) ? b : a;
        this.left *= a;
        this.right *= a;
        this.top *= c;
        this.bottom *= c;
        return this
    };

    function If(a, b, c, d) {
        this.left = a;
        this.top = b;
        this.width = c;
        this.height = d
    }
    r = If.prototype;
    r.N = function () {
        return new If(this.left, this.top, this.width, this.height)
    };
    r.contains = function (a) {
        return a instanceof If ? this.left <= a.left && this.left + this.width >= a.left + a.width && this.top <= a.top && this.top + this.height >= a.top + a.height : a.x >= this.left && a.x <= this.left + this.width && a.y >= this.top && a.y <= this.top + this.height
    };
    r.ceil = function () {
        this.left = Math.ceil(this.left);
        this.top = Math.ceil(this.top);
        this.width = Math.ceil(this.width);
        this.height = Math.ceil(this.height);
        return this
    };
    r.floor = function () {
        this.left = Math.floor(this.left);
        this.top = Math.floor(this.top);
        this.width = Math.floor(this.width);
        this.height = Math.floor(this.height);
        return this
    };
    r.round = function () {
        this.left = Math.round(this.left);
        this.top = Math.round(this.top);
        this.width = Math.round(this.width);
        this.height = Math.round(this.height);
        return this
    };
    r.scale = function (a, b) {
        var c = ia(b) ? b : a;
        this.left *= a;
        this.width *= a;
        this.top *= c;
        this.height *= c;
        return this
    };

    function Jf(a, b, c) {
        u(b) ? Kf(a, c, b) : fb(b, qa(Kf, a))
    }
    function Kf(a, b, c) {
        var d;
        a: if (d = Ia(c), a.style[d] === h && (c = (lc ? "Webkit" : kc ? "Moz" : G ? "ms" : jc ? "O" : n) + Ja(c), a.style[c] !== h)) {
            d = c;
            break a
        }
        d && (a.style[d] = b)
    }
    function Lf(a, b) {
        var c = Qc(a);
        return c.defaultView && c.defaultView.getComputedStyle && (c = c.defaultView.getComputedStyle(a, n)) ? c[b] || c.getPropertyValue(b) || "" : ""
    }
    function Mf(a, b) {
        return Lf(a, b) || (a.currentStyle ? a.currentStyle[b] : n) || a.style && a.style[b]
    }

    function Nf(a) {
        var b = a.getBoundingClientRect();
        G && (a = a.ownerDocument, b.left -= a.documentElement.clientLeft + a.body.clientLeft, b.top -= a.documentElement.clientTop + a.body.clientTop);
        return b
    }

    function Of(a) {
        if (G && !zc(8)) return a.offsetParent;
        var b = Qc(a),
            c = Mf(a, "position"),
            d = "fixed" == c || "absolute" == c;
        for (a = a.parentNode; a && a != b; a = a.parentNode) if (c = Mf(a, "position"), d = d && "static" == c && a != b.documentElement && a != b.body, !d && (a.scrollWidth > a.clientWidth || a.scrollHeight > a.clientHeight || "fixed" == c || "absolute" == c || "relative" == c)) return a;
        return n
    }

    function Pf(a) {
        for (var b = new Hf(0, Infinity, Infinity, 0), c = Oc(a), d = c.b.body, e = c.b.documentElement, f = !lc && Vc(c.b) ? c.b.documentElement : c.b.body; a = Of(a);) if ((!G || 0 != a.clientWidth) && (!lc || 0 != a.clientHeight || a != d) && a != d && a != e && "visible" != Mf(a, "overflow")) {
                var k = Qf(a),
                    l;
                l = a;
                if (kc && !yc("1.9")) {
                    var q = parseFloat(Lf(l, "borderLeftWidth"));
                    if (Rf(l)) var A = l.offsetWidth - l.clientWidth - q - parseFloat(Lf(l, "borderRightWidth")),
                    q = q + A;
                    l = new Xb(q, parseFloat(Lf(l, "borderTopWidth")))
                } else l = new Xb(l.clientLeft, l.clientTop);
                k.x += l.x;
                k.y += l.y;
                b.top = Math.max(b.top, k.y);
                b.right = Math.min(b.right, k.x + a.clientWidth);
                b.bottom = Math.min(b.bottom, k.y + a.clientHeight);
                b.left = Math.max(b.left, k.x)
            }
        d = f.scrollLeft;
        f = f.scrollTop;
        b.left = Math.max(b.left, d);
        b.top = Math.max(b.top, f);
        c = Uc(c.b.parentWindow || c.b.defaultView || window);
        b.right = Math.min(b.right, d + c.width);
        b.bottom = Math.min(b.bottom, f + c.height);
        return 0 <= b.top && 0 <= b.left && b.bottom > b.top && b.right > b.left ? b : n
    }

    function Sf(a) {
        var b = document.body,
            c = Qf(a),
            d = Qf(b),
            e = Tf(b),
            f = c.x - d.x - e.left,
            c = c.y - d.y - e.top,
            d = b.clientHeight - a.offsetHeight,
            e = b.scrollLeft,
            k = b.scrollTop,
            e = e + Math.min(f, Math.max(f - (b.clientWidth - a.offsetWidth), 0)),
            k = k + Math.min(c, Math.max(c - d, 0));
        a = new Xb(e, k);
        b.scrollLeft = a.x;
        b.scrollTop = a.y
    }

    function Qf(a) {
        var b, c = Qc(a),
            d = Mf(a, "position"),
            e = kc && c.getBoxObjectFor && !a.getBoundingClientRect && "absolute" == d && (b = c.getBoxObjectFor(a)) && (0 > b.screenX || 0 > b.screenY),
            f = new Xb(0, 0),
            k;
        b = c ? Qc(c) : document;
        k = G && !zc(9) && !yd(Oc(b)) ? b.body : b.documentElement;
        if (a == k) return f;
        if (a.getBoundingClientRect) b = Nf(a), a = zd(Oc(c)), f.x = b.left + a.x, f.y = b.top + a.y;
        else if (c.getBoxObjectFor && !e) b = c.getBoxObjectFor(a), a = c.getBoxObjectFor(k), f.x = b.screenX - a.screenX, f.y = b.screenY - a.screenY;
        else {
            b = a;
            do {
                f.x += b.offsetLeft;
                f.y +=
                    b.offsetTop;
                b != a && (f.x += b.clientLeft || 0, f.y += b.clientTop || 0);
                if (lc && "fixed" == Mf(b, "position")) {
                    f.x += c.body.scrollLeft;
                    f.y += c.body.scrollTop;
                    break
                }
                b = b.offsetParent
            } while (b && b != a);
            if (jc || lc && "absolute" == d) f.y -= c.body.offsetTop;
            for (b = a;
            (b = Of(b)) && b != c.body && b != k;) if (f.x -= b.scrollLeft, !jc || "TR" != b.tagName) f.y -= b.scrollTop
        }
        return f
    }

    function Uf(a) {
        var b = new Xb;
        if (1 == a.nodeType) {
            if (a.getBoundingClientRect) {
                var c = Nf(a);
                b.x = c.left;
                b.y = c.top
            } else {
                var c = zd(Oc(a)),
                    d = Qf(a);
                b.x = d.x - c.x;
                b.y = d.y - c.y
            } if (kc && !yc(12)) {
                var e;
                G ? e = "-ms-transform" : lc ? e = "-webkit-transform" : jc ? e = "-o-transform" : kc && (e = "-moz-transform");
                var f;
                e && (f = Mf(a, e));
                f || (f = Mf(a, "transform"));
                f ? (a = f.match(Vf), a = !a ? new Xb(0, 0) : new Xb(parseFloat(a[1]), parseFloat(a[2]))) : a = new Xb(0, 0);
                b = new Xb(b.x + a.x, b.y + a.y)
            }
        } else e = ja(a.Dh), f = a, a.targetTouches ? f = a.targetTouches[0] : e && a.Qa.targetTouches &&
                (f = a.Qa.targetTouches[0]), b.x = f.clientX, b.y = f.clientY;
        return b
    }
    function Wf(a, b) {
        "number" == typeof a && (a = (b ? Math.round(a) : a) + "px");
        return a
    }
    function Xf(a, b) {
        a.style.height = Wf(b, m)
    }
    function Yf(a) {
        if ("none" != Mf(a, "display")) return Zf(a);
        var b = a.style,
            c = b.display,
            d = b.visibility,
            e = b.position;
        b.visibility = "hidden";
        b.position = "absolute";
        b.display = "inline";
        a = Zf(a);
        b.display = c;
        b.position = e;
        b.visibility = d;
        return a
    }

    function Zf(a) {
        var b = a.offsetWidth,
            c = a.offsetHeight,
            d = lc && !b && !c;
        return (!fa(b) || d) && a.getBoundingClientRect ? (a = Nf(a), new Zb(a.right - a.left, a.bottom - a.top)) : new Zb(b, c)
    }
    function $f(a) {
        var b = Qf(a);
        a = Yf(a);
        return new If(b.x, b.y, a.width, a.height)
    }
    function Rf(a) {
        return "rtl" == Mf(a, "direction")
    }

    function ag(a, b) {
        if (/^\d+px?$/.test(b)) return parseInt(b, 10);
        var c = a.style.left,
            d = a.runtimeStyle.left;
        a.runtimeStyle.left = a.currentStyle.left;
        a.style.left = b;
        var e = a.style.pixelLeft;
        a.style.left = c;
        a.runtimeStyle.left = d;
        return e
    }
    function bg(a, b) {
        var c = a.currentStyle ? a.currentStyle[b] : n;
        return c ? ag(a, c) : 0
    }
    var cg = {
        thin: 2,
        medium: 4,
        thick: 6
    };

    function dg(a, b) {
        if ("none" == (a.currentStyle ? a.currentStyle[b + "Style"] : n)) return 0;
        var c = a.currentStyle ? a.currentStyle[b + "Width"] : n;
        return c in cg ? cg[c] : ag(a, c)
    }

    function Tf(a) {
        if (G) {
            var b = dg(a, "borderLeft"),
                c = dg(a, "borderRight"),
                d = dg(a, "borderTop");
            a = dg(a, "borderBottom");
            return new Hf(d, c, a, b)
        }
        b = Lf(a, "borderLeftWidth");
        c = Lf(a, "borderRightWidth");
        d = Lf(a, "borderTopWidth");
        a = Lf(a, "borderBottomWidth");
        return new Hf(parseFloat(d), parseFloat(c), parseFloat(a), parseFloat(b))
    }
    var Vf = /matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;

    function S(a, b, c) {
        a.dataset ? a.dataset[eg(b)] = c : a.setAttribute("data-" + b, c)
    }
    function T(a, b) {
        return a.dataset ? a.dataset[eg(b)] : a.getAttribute("data-" + b)
    }
    function fg(a, b) {
        a.dataset ? delete a.dataset[eg(b)] : a.removeAttribute("data-" + b)
    }
    function gg(a, b) {
        return a.dataset ? eg(b) in a.dataset : a.hasAttribute ? !! a.hasAttribute("data-" + b) : !! a.getAttribute("data-" + b)
    }
    var hg = {};

    function eg(a) {
        return hg[a] || (hg[a] = String(a).replace(/\-([a-z])/g, function (a, c) {
            return c.toUpperCase()
        }))
    };

    function ig(a) {
        var b = a.__yt_uid_key;
        b || (b = jg(), a.__yt_uid_key = b);
        return b
    }
    var jg = t("yt.dom.getNextId_");
    if (!jg) {
        jg = function () {
            return ++kg
        };
        x("yt.dom.getNextId_", jg);
        var kg = 0
    }
    function lg(a) {
        var b = a.cloneNode(p);
        "TR" == b.tagName || "SELECT" == b.tagName ? z(a.childNodes, function (a) {
            b.appendChild(lg(a))
        }) : b.innerHTML = a.innerHTML;
        return b
    }
    function mg(a) {
        a = lg(L(a));
        a.removeAttribute("id");
        return a
    }
    function ng(a, b) {
        a = L(a);
        b = L(b);
        return !!xd(a, function (a) {
            return a === b
        }, m, h)
    }

    function og(a, b, c) {
        a = Rc(a, b, c);
        return a.length ? a[0] : n
    }
    function pg(a, b) {
        "disabled" in a && (a.disabled = !b);
        1 == a.nodeType && Mc(a, "disabled", !b);
        if (a.hasChildNodes()) for (var c = 0, d; d = a.childNodes[c]; ++c) pg(d, b)
    }
    function qg(a, b) {
        if (a in b) return b[a];
        var c = a.charAt(0).toUpperCase() + a.substr(1);
        if ("moz" + c in b) return b["moz" + c];
        if ("ms" + c in b) return b["ms" + c];
        if ("o" + c in b) return b["o" + c];
        if ("webkit" + c in b) return b["webkit" + c]
    }

    function rg() {
        var a = document,
            b;
        Oa(["fullscreenElement", "fullScreenElement"], function (c) {
            b = qg(c, a);
            return !!b
        });
        return b
    };

    function sg(a) {
        if (a = a || window.event) {
            for (var b in a) b in tg || (this[b] = a[b]);
            this.scale = a.scale;
            this.rotation = a.rotation;
            this.hb = a;
            if ((b = a.target || a.srcElement) && 3 == b.nodeType) b = b.parentNode;
            this.target = b;
            if (b = a.relatedTarget) try {
                    b = b.nodeName && b
            } catch (c) {
                b = n
            } else "mouseover" == this.type ? b = a.fromElement : "mouseout" == this.type && (b = a.toElement);
            this.relatedTarget = b;
            this.clientX = a.clientX != h ? a.clientX : a.pageX;
            this.clientY = a.clientY != h ? a.clientY : a.pageY;
            if (document.body && document.documentElement) {
                b = document.body.scrollLeft +
                    document.documentElement.scrollLeft;
                var d = document.body.scrollTop + document.documentElement.scrollTop;
                this.pageX = a.pageX != h ? a.pageX : a.clientX + b;
                this.pageY = a.pageY != h ? a.pageY : a.clientY + d
            }
            this.keyCode = a.keyCode ? a.keyCode : a.which;
            this.charCode = a.charCode || ("keypress" == this.type ? this.keyCode : 0);
            this.altKey = a.altKey;
            this.ctrlKey = a.ctrlKey;
            this.shiftKey = a.shiftKey;
            "MozMousePixelScroll" == this.type ? (this.wheelDeltaX = a.axis == a.HORIZONTAL_AXIS ? a.detail : 0, this.wheelDeltaY = a.axis == a.HORIZONTAL_AXIS ? 0 : a.detail) :
                window.opera ? (this.wheelDeltaX = 0, this.wheelDeltaY = a.detail) : 0 == a.wheelDelta % 120 ? "WebkitTransform" in document.documentElement.style ? window.b && 0 == navigator.platform.indexOf("Mac") ? (this.wheelDeltaX = a.wheelDeltaX / -30, this.wheelDeltaY = a.wheelDeltaY / -30) : (this.wheelDeltaX = a.wheelDeltaX / -1.2, this.wheelDeltaY = a.wheelDeltaY / -1.2) : (this.wheelDeltaX = 0, this.wheelDeltaY = a.wheelDelta / -1.6) : (this.wheelDeltaX = a.wheelDeltaX / -3, this.wheelDeltaY = a.wheelDeltaY / -3)
        }
    }
    r = sg.prototype;
    r.hb = n;
    r.type = "";
    r.target = n;
    r.relatedTarget = n;
    r.currentTarget = n;
    r.data = n;
    r.keyCode = 0;
    r.charCode = 0;
    r.altKey = p;
    r.ctrlKey = p;
    r.shiftKey = p;
    r.clientX = 0;
    r.clientY = 0;
    r.pageX = 0;
    r.pageY = 0;
    r.wheelDeltaX = 0;
    r.wheelDeltaY = 0;
    r.rotation = 0;
    r.scale = 1;
    r.preventDefault = function () {
        this.hb.returnValue = p;
        this.hb.preventDefault && this.hb.preventDefault()
    };
    r.stopPropagation = function () {
        this.hb.cancelBubble = m;
        this.hb.stopPropagation && this.hb.stopPropagation()
    };
    var tg = {
        stopPropagation: 1,
        preventMouseEvent: 1,
        preventManipulation: 1,
        preventDefault: 1,
        layerX: 1,
        layerY: 1,
        scale: 1,
        rotation: 1
    };
    var ug = t("yt.events.listeners_") || {};
    x("yt.events.listeners_", ug);
    var vg = t("yt.events.counter_") || {
        count: 0
    };
    x("yt.events.counter_", vg);

    function wg(a, b, c, d) {
        return jb(ug, function (e) {
            return e[0] == a && e[1] == b && e[2] == c && e[4] == !! d
        })
    }

    function U(a, b, c, d) {
        if (!a || !a.addEventListener && !a.attachEvent) return "";
        d = !! d;
        var e = wg(a, b, c, d);
        if (e) return e;
        var e = ++vg.count + "",
            f = !(!("mouseenter" == b || "mouseleave" == b) || !a.addEventListener || "onmouseenter" in document),
            k;
        k = f ? function (d) {
            d = new sg(d);
            if (!xd(d.relatedTarget, function (b) {
                return b == a
            }, m)) return d.currentTarget = a, d.type = b, c.call(a, d)
        } : function (b) {
            b = new sg(b);
            b.currentTarget = a;
            return c.call(a, b)
        };
        ug[e] = [a, b, c, k, d];
        a.addEventListener ? "mouseenter" == b && f ? a.addEventListener("mouseover", k, d) :
            "mouseleave" == b && f ? a.addEventListener("mouseout", k, d) : "mousewheel" == b && "MozBoxSizing" in document.documentElement.style ? a.addEventListener("MozMousePixelScroll", k, d) : a.addEventListener(b, k, d) : a.attachEvent("on" + b, k);
        return e
    }
    function xg(a, b, c) {
        var d;
        return d = U(a, b, function () {
            V(d);
            c.apply(a, arguments)
        }, h)
    }
    function yg(a) {
        return zg(a, "click", Ag, function (a) {
            return "a" === a.nodeName.toLowerCase() && m
        })
    }
    function W(a, b, c, d) {
        return zg(a, b, c, function (a) {
            return K(a, d)
        })
    }

    function zg(a, b, c, d) {
        var e = a || document;
        return U(e, b, function (a) {
            var b = xd(a.target, function (a) {
                return a === e || d(a)
            }, m);
            b && (b !== e && !b.disabled) && (a.currentTarget = b, c.call(b, a))
        })
    }
    function Bg(a, b, c) {
        (a = wg(a, b, c, p)) && V(a)
    }
    function V(a) {
        "string" == typeof a && (a = [a]);
        z(a, function (a) {
            if (a in ug) {
                var c = ug[a],
                    d = c[0],
                    e = c[1],
                    f = c[3],
                    c = c[4];
                d.removeEventListener ? d.removeEventListener(e, f, c) : d.detachEvent("on" + e, f);
                delete ug[a]
            }
        })
    }

    function Cg(a) {
        a = a || window.event;
        a.cancelBubble = m;
        a.stopPropagation && a.stopPropagation()
    }
    function Dg(a) {
        if (document.createEvent) {
            var b = document.createEvent("HTMLEvents");
            b.initEvent("click", m, m);
            a.dispatchEvent(b)
        } else b = document.createEventObject(), a.fireEvent("onclick", b)
    };

    function Eg(a, b) {
        this.g = a;
        this.ba = b;
        this.e = Rc("img", n, a)[0];
        this.C = this.i = 0;
        this.onError = function () {};
        this.b = {};
        this.A = n;
        this.K = []
    }
    y(Eg, Cb);
    r = Eg.prototype;
    r.P = function () {
        V(this.K);
        this.K = [];
        this.b = {};
        this.e = n;
        Eg.L.P.call(this)
    };

    function Fg(a, b, c) {
        if (a.pd(b)) c && c();
        else if (!(b in a.b && "requested" == a.b[b])) if (b in a.b && "error" == a.b[b]) a.onError();
            else {
                var d = new Image;
                a.K.push(U(d, "load", v(function () {
                    this.b[b] = "loaded";
                    c && c()
                }, a)));
                a.K.push(U(d, "error", v(function () {
                    this.b[b] = "error";
                    this.onError()
                }, a)));
                d.src = b
            }
    }
    r.pd = function (a) {
        return a in this.b && "loaded" == this.b[a]
    };
    r.start = function () {
        this.A && this.stop();
        this.De()
    };
    r.De = function () {
        this.i == this.C && (this.i = 0);
        this.Fe();
        this.i++;
        var a = 1E3 / this.Ee();
        this.A = D(v(this.De, this), a)
    };
    r.stop = function () {
        this.A && (window.clearInterval(this.A), this.A = n)
    };
    r.Ee = function () {
        return 1
    };

    function Gg(a, b) {
        Eg.call(this, a, b);
        this.j = Hg(this.e.src.substring(0, this.e.src.lastIndexOf("/") + 1));
        this.U = this.e.src;
        this.C = Ig.length
    }
    y(Gg, Eg);

    function Hg(a) {
        var b = [];
        z(Ig, function (c) {
            b.push(a + c)
        });
        return b
    }
    Gg.prototype.Zd = function (a) {
        Pa(this.j, this.pd, this) ? a && a() : z(this.j, v(function (b) {
            Fg(this, b, v(function () {
                Pa(this.j, this.pd, this) && a && a()
            }, this))
        }, this))
    };
    Gg.prototype.Fe = function () {
        this.e.src = this.j[this.i]
    };
    Gg.prototype.stop = function () {
        Gg.L.stop.call(this);
        this.e.src = this.U
    };
    var Ig = ["1.jpg", "2.jpg", "3.jpg"];

    function Jg(a, b) {
        if ((a = L(a)) && a.style) a.style.display = b ? "" : "none", Mc(a, "hid", !b)
    }
    function Kg(a) {
        a = L(a);
        return !a ? p : !("none" == a.style.display || K(a, "hid"))
    }
    function Lg(a) {
        if (a = L(a)) Kg(a) ? (a.style.display = "none", I(a, "hid")) : (a.style.display = "", J(a, "hid"))
    }
    function Mg(a) {
        if (a = L(a)) a.style.visibility = "visible"
    }
    function Ng(a) {
        a = L(a);
        if (!a) return n;
        var b = 0,
            c = 0;
        if (a.offsetParent) {
            do b += a.offsetLeft, c += a.offsetTop; while (a = a.offsetParent)
        }
        return new Xb(b, c)
    }
    function X(a) {
        z(arguments, function (a) {
            Jg(a, m)
        })
    }

    function Y(a) {
        z(arguments, function (a) {
            Jg(a, p)
        })
    }
    function Og(a) {
        z(arguments, Lg)
    }
    function Pg(a, b, c) {
        if ((a = L(a)) && a.style) {
            a: {
                var d = document.body;
                if (d.style[b] == h) {
                    b = b.charAt(0).toUpperCase() + b.substr(1);
                    for (var e = ["Moz", "Webkit", "ms", "O"], f = 0; f < e.length; f++) if (d.style[e[f] + b] != h) {
                            b = e[f] + b;
                            break a
                        }
                    b = h
                }
            }
            b && (a.style[b] = c)
        }
    };

    function Qg(a, b, c) {
        this.A = a;
        this.g = b.frame_width;
        this.o = b.frame_height;
        this.j = b.number_of_frames;
        this.b = b.max_frames_per_row;
        this.e = b.max_frames_per_column;
        this.C = c.replace("$N", b.image_name_pattern);
        this.i = b.url_signatures
    }
    function Rg(a, b) {
        var c = 1 < a.i.length ? a.i[b] : a.i[0],
            d = a.C,
            d = d.replace("$L", a.A + ""),
            d = d.replace("$M", b + "");
        return d = Ie(d, {
            sigh: c
        })
    };

    function Sg(a) {
        this.g = a.url_pattern;
        this.b = Tg(this, a.levels);
        this.e = {}
    }
    function Tg(a, b) {
        var c = [];
        z(b, function (a, b) {
            c.push(new Qg(b, a, this.g))
        }, a);
        return c
    };

    function Ug(a, b) {
        Eg.call(this, a, b);
        this.ub = n;
        this.j = 0;
        Yf(this.e)
    }
    y(Ug, Eg);
    r = Ug.prototype;
    r.Zd = function (a) {
        Vg(this, v(function () {
            this.U = Yf(this.g);
            var b;
            a: {
                b = this.ub;
                var c = this.U.width,
                    d = b.e[c];
                if (!d) {
                    for (d = 0; d < b.b.length; d++) if (b.b[d].g >= c) {
                            b = b.e[c] = d;
                            break a
                        }
                    d = b.b.length - 1;
                    b.e[c] = d
                }
                b = d
            }
            this.j = b;
            this.C = this.ub.b[this.j].j;
            Wg(this, 0, a)
        }, this))
    };

    function Wg(a, b, c) {
        var d = a.ub.b[a.j];
        b = Rg(d, Math.floor(b / (d.b * d.e)));
        Fg(a, b, c)
    }

    function Vg(a, b) {
        R("/storyboard_info_ajax", {
            G: {
                action_get_storyboard_info: 1,
                v: a.ba
            },
            B: function (a, d) {
                this.ub = new Sg(d.storyboard);
                b && b()
            },
            onError: a.onError,
            R: a
        })
    }
    r.start = function () {
        Y(this.e);
        Ug.L.start.call(this)
    };
    r.Fe = function () {
        var a, b, c, d, e = this.ub.b[this.j];
        a = e.b * e.e;
        d = Math.floor(this.i / (e.b * e.e)) * a;
        e = Math.min(d + a - 1, e.j - 1);
        d = [d, e];
        e = this.i + Xg[this.j];
        e > d[1] && e < this.C && Wg(this, d[1] + 1);
        d = this.ub.b[this.j];
        a = this.i;
        e = this.U;
        c = a % (d.b * d.e);
        b = c % d.b;
        c = Math.floor(c / d.b);
        var f = e.width / d.g,
            k = (d.o - d.g / (e.width / e.height)) / 2;
        a = Rg(d, Math.floor(a / (d.b * d.e)));
        b = Math.floor(b * d.g * f);
        c = Math.floor((c * d.o + k) * f);
        d = e.width * d.b + "px auto";
        e = "url(" + a + ")";
        a = -b + "px " + -c + "px";
        this.g.style.backgroundImage != e && Pg(this.g, "backgroundImage",
            e);
        this.g.style.backgroundSize != d && Pg(this.g, "backgroundSize", d);
        Pg(this.g, "backgroundPosition", a)
    };
    r.stop = function () {
        Ug.L.stop.call(this);
        X(this.e);
        Pg(this.g, "backgroundImage", "");
        Pg(this.g, "backgroundPosition", "");
        Pg(this.g, "backgroundSize", "")
    };
    r.Ee = function () {
        return Yg[this.j]
    };
    var Yg = [5, 5, 5, 3],
        Xg = [10, 10, 10, 5];

    function Zg(a, b, c) {
        this.A = a;
        this.$ = b;
        this.j = this.g = this.C = p;
        this.i = function () {};
        this.e = n;
        c ? (this.e = new Ug(this.A, this.$), this.e.onError = v(this.hg, this)) : this.e = new Gg(this.A, this.$)
    }
    y(Zg, Cb);
    r = Zg.prototype;
    r.P = function () {
        $g(this);
        Zg.L.P.call(this)
    };
    r.hg = function () {
        $g(this);
        this.e = new Gg(this.A, this.$);
        this.load(v(this.start, this))
    };
    r.load = function (a) {
        a && (this.i = a);
        this.b ? this.i() : this.e.Zd(v(this.Rf, this))
    };
    r.Rf = function () {
        this.b = m;
        this.i()
    };

    function $g(a) {
        a.g && a.stop();
        Eb(a.e);
        a.e = n;
        a.i = function () {};
        a.C = p
    }
    r.start = function () {
        this.b && !this.g && (this.j ? this.j = p : (this.g = m, this.e.start()))
    };
    r.stop = function () {
        this.g ? (this.e.stop(), this.g = p) : this.C || (this.j = m)
    };
    var ah = {}, bh = "ontouchstart" in document;

    function ch(a, b, c) {
        b in ah || (ah[b] = new Fb);
        ah[b].aa(a, c)
    }
    function dh(a, b) {
        if ("click" in ah) {
            var c = ah.click;
            c.va(a, b);
            0 >= c.nb() && (c.ma(), delete ah.click)
        }
    }
    function eh(a, b, c) {
        var d;
        switch (a) {
            case "mouseover":
            case "mouseout":
                d = 3;
                break;
            case "mouseenter":
            case "mouseleave":
                d = 9
        }
        return xd(c, function (a) {
            return K(a, b)
        }, m, d)
    }

    function fh(a) {
        var b = "mouseover" == a.type && "mouseenter" in ah || "mouseout" == a.type && "mouseleave" in ah,
            c = a.type in ah || b;
        if ("HTML" != a.target.tagName && c) {
            if (b) {
                var b = "mouseover" == a.type ? "mouseenter" : "mouseleave",
                    c = ah[b],
                    d;
                for (d in c.la) {
                    var e = eh(b, d, a.target);
                    e && !xd(a.relatedTarget, function (a) {
                        return a == e
                    }, m) && c.M(d, e, b, a)
                }
            }
            if (b = ah[a.type]) for (d in b.la)(e = eh(a.type, d, a.target)) && b.M(d, e, a.type, a)
        }
    }
    U(document, "blur", fh, m);
    U(document, "change", fh, m);
    U(document, "click", fh);
    U(document, "focus", fh, m);
    U(document, "mouseover", fh);
    U(document, "mouseout", fh);
    U(document, "mousedown", fh);
    U(document, "keydown", fh);
    U(document, "keyup", fh);
    U(document, "keypress", fh);
    U(document, "cut", fh);
    U(document, "paste", fh);
    bh && (U(document, "touchstart", fh), U(document, "touchend", fh), U(document, "touchcancel", fh));
    var gh = window.yt && window.yt.uix && window.yt.uix.widgets_ || {};
    x("yt.uix.widgets_", gh);

    function hh(a) {
        a = a.getInstance();
        var b = Z(a);
        !(b in gh) && a.zd() && (a.register(), gh[b] = a)
    };

    function ih() {
        this.b = {}
    }
    r = ih.prototype;
    r.td = !! eval("/*@cc_on!@*/false");
    r.zd = function () {
        return m
    };

    function $(a, b, c, d) {
        d = Z(a, d);
        var e = v(c, a);
        ch(d, b, e);
        a.b[c] = e
    }
    r.oa = function (a, b, c) {
        var d = this.k(a, b);
        if (d && (d = t(d))) {
            var e = ab(arguments, 2);
            $a(e, 0, 0, a);
            d.apply(n, e)
        }
    };
    r.k = function (a, b) {
        return T(a, b)
    };
    r.Y = function (a) {
        return Q(a, Z(this))
    };

    function Z(a, b) {
        return "yt-uix" + (a.X ? "-" + a.X : "") + (b ? "-" + b : "")
    };

    function jh() {
        this.b = {};
        this.e = {}
    }
    y(jh, ih);
    da(jh);
    jh.prototype.X = "animated-thumb";
    jh.prototype.register = function () {
        $(this, "mouseenter", this.g);
        $(this, "mouseleave", this.i)
    };
    jh.prototype.g = function (a) {
        S(a, "hover", "true");
        var b = parseInt(this.k(a, "animation-delay"), 10) || 500;
        D(v(function () {
            "true" == this.k(a, "hover") && (S(a, "animation-start", +new Date + ""), kh(this, a))
        }, this), b)
    };
    jh.prototype.i = function (a) {
        fg(a, "hover");
        var b = parseInt(this.k(a, "animation-start"), 10);
        isNaN(b) || (b = {
            duration: new Date - b,
            v: this.k(a, "video-id")
        }, b = He(b), Df("animated-thumb-hover", b, h), fg(a, "animation-start"), (a = this.e[la(a)]) && a.stop())
    };

    function kh(a, b) {
        var c = lh(a, b);
        c && (c.C ? c.start() : c.load(function () {
            c.start()
        }))
    }
    function lh(a, b) {
        var c = a.e[la(b)];
        if (!c) {
            var d = a.k(b, "video-id");
            d && (c = K(b, Z(a, "storyboard")), c = new Zg(b, d, c), a.e[la(b)] = c)
        }
        return c
    };

    function mh(a, b, c, d, e, f, k) {
        var l, q;
        if (l = c.offsetParent) {
            var A = "HTML" == l.tagName || "BODY" == l.tagName;
            if (!A || "static" != Mf(l, "position")) q = Qf(l), A || (A = (A = Rf(l)) && kc ? -l.scrollLeft : A && (!G || !yc("8")) && "visible" != Mf(l, "overflowX") ? l.scrollWidth - l.clientWidth - l.scrollLeft : l.scrollLeft, q = Yb(q, new Xb(A, l.scrollTop)))
        }
        l = q || new Xb;
        q = $f(a);
        if (A = Pf(a)) {
            var H = new If(A.left, A.top, A.right - A.left, A.bottom - A.top),
                A = Math.max(q.left, H.left),
                O = Math.min(q.left + q.width, H.left + H.width);
            if (A <= O) {
                var P = Math.max(q.top, H.top),
                    H = Math.min(q.top + q.height, H.top + H.height);
                P <= H && (q.left = A, q.top = P, q.width = O - A, q.height = H - P)
            }
        }
        A = Oc(a);
        P = Oc(c);
        if (A.b != P.b) {
            var O = A.b.body,
                P = P.b.parentWindow || P.b.defaultView,
                H = new Xb(0, 0),
                ba = Qc(O) ? Qc(O).parentWindow || Qc(O).defaultView : window,
                Xa = O;
            do {
                var nb = ba == P ? Qf(Xa) : Uf(Xa);
                H.x += nb.x;
                H.y += nb.y
            } while (ba && ba != P && (Xa = ba.frameElement) && (ba = ba.parent));
            O = Yb(H, Qf(O));
            G && !yd(A) && (O = Yb(O, zd(A)));
            q.left += O.x;
            q.top += O.y
        }
        a = (b & 4 && Rf(a) ? b ^ 2 : b) & -5;
        b = new Xb(a & 2 ? q.left + q.width : q.left, a & 1 ? q.top + q.height : q.top);
        b =
            Yb(b, l);
        e && (b.x += (a & 2 ? -1 : 1) * e.x, b.y += (a & 1 ? -1 : 1) * e.y);
        var Ha;
        if (k && (Ha = Pf(c))) Ha.top -= l.y, Ha.right -= l.x, Ha.bottom -= l.y, Ha.left -= l.x;
        return nh(b, c, d, f, Ha, k, h)
    }

    function nh(a, b, c, d, e, f, k) {
        a = a.N();
        var l = 0,
            q = (c & 4 && Rf(b) ? c ^ 2 : c) & -5;
        c = Yf(b);
        k = k ? k.N() : c.N();
        if (d || 0 != q) q & 2 ? a.x -= k.width + (d ? d.right : 0) : d && (a.x += d.left), q & 1 ? a.y -= k.height + (d ? d.bottom : 0) : d && (a.y += d.top);
        if (f) {
            if (e) {
                l = a;
                d = 0;
                if (65 == (f & 65) && (l.x < e.left || l.x >= e.right)) f &= -2;
                if (132 == (f & 132) && (l.y < e.top || l.y >= e.bottom)) f &= -5;
                l.x < e.left && f & 1 && (l.x = e.left, d |= 1);
                l.x < e.left && (l.x + k.width > e.right && f & 16) && (k.width = Math.max(k.width - (l.x + k.width - e.right), 0), d |= 4);
                l.x + k.width > e.right && f & 1 && (l.x = Math.max(e.right - k.width,
                    e.left), d |= 1);
                f & 2 && (d |= (l.x < e.left ? 16 : 0) | (l.x + k.width > e.right ? 32 : 0));
                l.y < e.top && f & 4 && (l.y = e.top, d |= 2);
                l.y <= e.top && (l.y + k.height < e.bottom && f & 32) && (k.height = Math.max(k.height - (e.top - l.y), 0), l.y = 0, d |= 8);
                l.y >= e.top && (l.y + k.height > e.bottom && f & 32) && (k.height = Math.max(k.height - (l.y + k.height - e.bottom), 0), d |= 8);
                l.y + k.height > e.bottom && f & 4 && (l.y = Math.max(e.bottom - k.height, e.top), d |= 2);
                f & 8 && (d |= (l.y < e.top ? 64 : 0) | (l.y + k.height > e.bottom ? 128 : 0));
                l = d
            } else l = 256; if (l & 496) return l
        }
        f = a;
        e = kc && (dc || oc) && yc("1.9");
        f instanceof
        Xb ? (a = f.x, f = f.y) : (a = f, f = h);
        b.style.left = Wf(a, e);
        b.style.top = Wf(f, e);
        if (!(c == k || (!c || !k ? 0 : c.width == k.width && c.height == k.height))) a = yd(Oc(Qc(b))), G && (!a || !yc("8")) ? (c = b.style, a ? (G ? (a = bg(b, "paddingLeft"), e = bg(b, "paddingRight"), f = bg(b, "paddingTop"), d = bg(b, "paddingBottom"), a = new Hf(f, e, d, a)) : (a = Lf(b, "paddingLeft"), e = Lf(b, "paddingRight"), f = Lf(b, "paddingTop"), d = Lf(b, "paddingBottom"), a = new Hf(parseFloat(f), parseFloat(e), parseFloat(d), parseFloat(a))), b = Tf(b), c.pixelWidth = k.width - b.left - a.left - a.right - b.right,
                c.pixelHeight = k.height - b.top - a.top - a.bottom - b.bottom) : (c.pixelWidth = k.width, c.pixelHeight = k.height)) : (b = b.style, kc ? b.MozBoxSizing = "border-box" : lc ? b.WebkitBoxSizing = "border-box" : b.boxSizing = "border-box", b.width = Math.max(k.width, 0) + "px", b.height = Math.max(k.height, 0) + "px");
        return l
    };

    function oh() {
        this.b = {}
    }
    y(oh, ih);
    da(oh);
    r = oh.prototype;
    r.X = "button";
    r.register = function () {
        $(this, "click", this.Ph);
        $(this, "keydown", this.Oh);
        $(this, "keypress", this.Qh)
    };
    r.Ph = function (a) {
        if (a && !a.disabled) {
            ph(this, a);
            if (qh(this, a)) {
                var b = qh(this, a),
                    c = Q(b.activeButtonNode || b.parentNode, Z(this));
                c && c != a ? (rh(this, c), D(v(this.Pe, this, a), 1)) : Kg(b) ? rh(this, a) : this.Pe(a);
                a.focus()
            }
            this.oa(a, "button-action")
        }
    };
    r.Oh = function (a, b, c) {
        if (!c.altKey && (!c.ctrlKey && !c.shiftKey) && (b = qh(this, a))) {
            var d = function (a) {
                var b = "";
                a.tagName && (b = a.tagName.toLowerCase());
                return "ul" == b || "table" == b
            };
            if (d = d(b) ? b : qd(b, d)) {
                var d = d.tagName.toLowerCase(),
                    e;
                "ul" == d ? e = this.Yh : "table" == d && (e = this.Xh);
                e && sh(this, a, b, c, v(e, this))
            }
        }
    };

    function sh(a, b, c, d, e) {
        var f = Kg(c),
            k = 9 == d.keyCode;
        k || 32 == d.keyCode || 13 == d.keyCode ? (d = th(a, c)) ? (b = kd(d), "a" == b.tagName.toLowerCase() ? window.location = b.href : Dg(b)) : k && rh(a, b) : f ? 27 == d.keyCode ? (th(a, c), rh(a, b)) : e(b, c, d) : (a = K(b, Z(a, "reverse")) ? 38 : 40, d.keyCode == a && (Dg(b), d.preventDefault()))
    }
    r.Qh = function (a, b, c) {
        !c.altKey && (!c.ctrlKey && !c.shiftKey) && (a = qh(this, a), Kg(a) && c.preventDefault())
    };

    function th(a, b) {
        var c = Z(a, "menu-item-highlight"),
            d = N(c, b);
        d && J(d, c);
        return d
    }

    function uh(a, b, c) {
        I(c, Z(a, "menu-item-highlight"));
        b.setAttribute("aria-activedescendant", c.getAttribute("id"))
    }
    r.Xh = function (a, b, c) {
        var d = th(this, b);
        b = og("table", n, b);
        var e = og("tr", n, b),
            e = Rc("td", n, e).length;
        b = Rc("td", n, b);
        d = vh(d, b, e, c); - 1 != d && (uh(this, a, b[d]), c.preventDefault())
    };
    r.Yh = function (a, b, c) {
        if (40 == c.keyCode || 38 == c.keyCode) {
            var d = th(this, b);
            b = Rc("li", n, b);
            d = vh(d, b, 1, c);
            uh(this, a, b[d]);
            c.preventDefault()
        }
    };

    function vh(a, b, c, d) {
        var e = b.length;
        a = La(b, a);
        if (-1 == a) if (38 == d.keyCode) a = e - c;
            else {
                if (37 == d.keyCode || 38 == d.keyCode || 40 == d.keyCode) a = 0
            } else 39 == d.keyCode ? (a % c == c - 1 && (a -= c), a += 1) : 37 == d.keyCode ? (0 == a % c && (a += c), a -= 1) : 38 == d.keyCode ? (a < c && (a += e), a -= c) : 40 == d.keyCode && (a >= e - c && (a -= e), a += c);
        return a
    }
    function wh(a, b) {
        var c = b.iframeMask;
        c || (c = document.createElement("iframe"), c.src = 'javascript:""', c.className = Z(a, "menu-mask"), b.iframeMask = c);
        return c
    }

    function xh(a, b) {
        if (a.k(b, "button-menu-root-container")) {
            var c = a.k(b, "button-menu-root-container");
            return Q(b, c)
        }
        return document.body
    }
    r.Pe = function (a) {
        if (a) {
            var b = qh(this, a);
            if (b) {
                a.setAttribute("aria-pressed", "true");
                a.setAttribute("aria-expanded", "true");
                b.originalParentNode = b.parentNode;
                b.activeButtonNode = a;
                b.parentNode.removeChild(b);
                var c;
                c = this.k(a, "button-has-sibling-menu") ? a.parentNode : xh(this, a);
                c.appendChild(b);
                b.style.minWidth = a.offsetWidth - 2 + "px";
                var d = wh(this, a);
                d && c.appendChild(d);
                c = Q(a, Z(this, "group"));
                d = !! this.k(a, "button-menu-ignore-group");
                c = c && !d ? c : a;
                var d = 5,
                    e = 4,
                    f = $f(a);
                if (K(a, Z(this, "reverse"))) {
                    d = 4;
                    e = 5;
                    f = f.top +
                        "px";
                    try {
                        b.style.maxHeight = f
                    } catch (k) {}
                }
                K(a, "flip") && (K(a, Z(this, "reverse")) ? (d = 6, e = 7) : (d = 7, e = 6));
                var l;
                this.k(a, "button-has-sibling-menu") ? l = Of(c) : this.k(a, "button-menu-root-container") && (l = xh(this, a));
                G && !yc("8") && (l = n);
                var q;
                l && (q = $f(l), q = new Hf(-q.top, q.left, q.top, -q.left));
                l = new Xb(0, 1);
                K(a, Z(this, "center-menu")) && (l.x -= Math.round((Yf(b).width - Yf(a).width) / 2));
                if (f = wh(this, a)) {
                    var A = Yf(b);
                    f.style.width = A.width + "px";
                    f.style.height = A.height + "px";
                    mh(c, d, f, e, l, q, 65)
                }
                mh(c, d, b, e, l, q, 65);
                X(b);
                this.oa(a,
                    "button-menu-action", m);
                I(a, Z(this, "active"));
                q = v(this.oh, this, a);
                b = U(document, "click", q);
                q = U(document, "contextmenu", q);
                S(a, "button-listener", b);
                S(a, "button-context-menu-listener", q)
            }
        }
    };

    function rh(a, b) {
        if (b) {
            var c = qh(a, b);
            if (c) {
                b.setAttribute("aria-pressed", "false");
                b.setAttribute("aria-expanded", "false");
                b.removeAttribute("aria-activedescendant");
                Y(c);
                a.oa(b, "button-menu-action", p);
                var d = wh(a, b);
                D(function () {
                    d && d.parentNode && d.parentNode.removeChild(d);
                    c.originalParentNode && (c.parentNode.removeChild(c), c.originalParentNode.appendChild(c), c.originalParentNode = n, c.activeButtonNode = n)
                }, 1)
            }
            var e = Q(b, Z(a, "group"));
            J(b, Z(a, "active"));
            e && J(e, Z(a, "group-active"));
            if (e = a.k(b, "button-listener")) V(e),
            fg(b, "button-listener");
            if (e = a.k(b, "button-context-menu-listener")) V(e), fg(b, "button-context-menu-listener")
        }
    }
    r.oh = function (a, b) {
        var c;
        c = b || window.event;
        c = c.target || c.srcElement;
        3 == c.nodeType && (c = c.parentNode);
        var d = Q(c, Z(this));
        if (d) {
            var d = qh(this, d),
                e = qh(this, a);
            if (d == e) return
        }
        if (!Q(c, Z(this, "menu")) || K(c, Z(this, "menu-item")) || K(c, Z(this, "menu-close"))) if (rh(this, a), (d = Q(c, Z(this, "menu"))) && this.k(a, "button-menu-indicate-selected"))(e = N(Z(this, "content"), a)) && pd(e, ud(c)), e = Z(this, "menu-item-selected"), (d = N(e, d)) && J(d, e), I(c.parentNode, e)
    };

    function qh(a, b) {
        if (!b.widgetMenu) {
            var c = a.k(b, "button-menu-id"),
                c = c && L(c),
                d = Z(a, "menu");
            c ? (I(c, d), I(c, Z(a, "menu-external"))) : c = N(d, b);
            b.widgetMenu = c
        }
        return b.widgetMenu
    }
    function yh(a, b) {
        var c = L(b);
        if (c) {
            var d = Z(a, "toggled"),
                c = M(d, c);
            z(c, function (a) {
                J(a, d)
            })
        }
    }
    function zh(a, b) {
        return K(b, Z(a, "toggled"))
    }

    function ph(a, b) {
        if (a.k(b, "button-toggle")) {
            var c = Q(b, Z(a, "group"));
            if (c && a.k(c, "button-toggle-group")) {
                var d = a.k(c, "button-toggle-group"),
                    c = M(Z(a), c),
                    e = Z(a, "toggled"),
                    f = K(b, e);
                z(c, function (a) {
                    a != b || "optional" == d && f ? J(a, e) : I(b, e)
                })
            } else Nc(b, Z(a, "toggled"))
        }
    };

    function Ah() {
        this.b = {}
    }
    y(Ah, ih);
    da(Ah);
    Ah.prototype.X = "char-counter";
    Ah.prototype.register = function () {
        $(this, "keydown", this.e, "input");
        $(this, "paste", this.e, "input");
        $(this, "cut", this.e, "input")
    };
    Ah.prototype.e = function (a) {
        var b = this.Y(a);
        if (b) {
            var c = "true" == this.k(b, "count-char-by-size"),
                d = parseInt(this.k(b, "char-limit"), 10);
            isNaN(d) || 0 >= d || D(v(function () {
                var e = parseInt(a.getAttribute("maxlength"), 10);
                if (!isNaN(e)) {
                    var f = Bh(a, c);
                    if (c) {
                        if (f > e) {
                            var k = a.value,
                                l = k.length,
                                q = 0,
                                e = f - e,
                                f = "",
                                A = 0;
                            do f += k[l - q], A = unescape(encodeURIComponent(f)).length, q++; while (A < e);
                            a.value = a.value.substring(0, l - q)
                        }
                    } else f > e && (a.value = a.value.substring(0, e))
                }
                k = parseInt(this.k(b, "warn-at-chars-remaining"), 10);
                isNaN(k) &&
                    (k = 0);
                l = d - Bh(a, c);
                Mc(b, Z(this, "maxed-out"), l < k);
                N(Z(this, "remaining"), b).innerHTML = l
            }, this), 0)
        }
    };

    function Bh(a, b) {
        var c = a.value;
        return b ? unescape(encodeURIComponent(c)).length : c.length
    };

    function Ch() {
        this.b = {}
    }
    y(Ch, ih);
    r = Ch.prototype;
    r.zd = function () {
        return this.td && 0 == wc.indexOf("6") ? p : m
    };
    r.Y = function (a) {
        var b = ih.prototype.Y.call(this, a);
        return !b ? a : b
    };
    r.k = function (a, b) {
        var c = Ch.L.k.call(this, a, b);
        if (c) return c;
        if (c = Ch.L.k.call(this, a, "card-config")) if ((c = t(c)) && c[b]) return c[b];
        return n
    };
    r.show = function (a) {
        var b = this.Y(a);
        if (b) {
            I(b, Z(this, "active"));
            var c = Dh(this, a, b);
            if (c) {
                c.cardTargetNode = a;
                c.cardRootNode = b;
                Eh(this, a, c);
                var d = Z(this, "card-visible"),
                    e = this.k(a, "card-delegate-show") && this.k(b, "card-action");
                this.oa(b, "card-action", a);
                this.e = a;
                Y(c);
                D(function () {
                    e || X(c);
                    I(c, d)
                }, 10)
            }
        }
    };

    function Dh(a, b, c) {
        var d = c || b,
            e = Z(a, "card"),
            f = e + ig(d);
        c = L(f);
        var k = Fh(a, d);
        if (c) return c;
        c = document.createElement("div");
        c.id = f;
        c.className = e;
        (d = a.k(d, "card-class")) && I(c, d);
        d = document.createElement("div");
        d.className = Z(a, "card-border");
        b = a.k(b, "orientation") || "horizontal";
        e = document.createElement("div");
        e.className = "yt-uix-card-border-arrow yt-uix-card-border-arrow-" + b;
        f = document.createElement("div");
        f.className = Z(a, "card-body");
        a = document.createElement("div");
        a.className = "yt-uix-card-body-arrow yt-uix-card-body-arrow-" +
            b;
        fd(k);
        f.appendChild(k);
        d.appendChild(a);
        d.appendChild(f);
        c.appendChild(e);
        c.appendChild(d);
        document.body.appendChild(c);
        return c
    }

    function Eh(a, b, c) {
        var d = a.k(b, "orientation") || "horizontal",
            e = a.k(b, "position"),
            f = !! a.k(b, "force-position"),
            d = "horizontal" == d,
            k = "bottomright" == e || "bottomleft" == e,
            l = "topright" == e || "bottomright" == e,
            q, A;
        l && k ? (A = 7, q = 4) : l && !k ? (A = 6, q = 5) : !l && k ? (A = 5, q = 6) : (A = 4, q = 7);
        var H = Rf(document.body),
            e = Rf(b);
        H != e && (A ^= 2);
        var O;
        d ? (e = b.offsetHeight / 2 - 12, O = new Xb(-12, b.offsetHeight + 6)) : (e = b.offsetWidth / 2 - 6, O = new Xb(b.offsetWidth + 6, -12));
        var P = Yf(c),
            e = Math.min(e, (d ? P.height : P.width) - 24 - 6);
        6 > e && (e = 6, d ? O.y += 12 - b.offsetHeight /
            2 : O.x += 12 - b.offsetWidth / 2);
        var ba = n;
        f || (ba = 10);
        P = Z(a, "card-flip");
        a = Z(a, "card-reverse");
        Mc(c, P, l);
        Mc(c, a, k);
        ba = mh(b, A, c, q, O, n, ba);
        !f && ba && (ba & 48 && (l = !l, A ^= 2, q ^= 2), ba & 192 && (k = !k, A ^= 1, q ^= 1), Mc(c, P, l), Mc(c, a, k), mh(b, A, c, q, O));
        b = N("yt-uix-card-body-arrow", c);
        f = N("yt-uix-card-border-arrow", c);
        d = d ? k ? "top" : "bottom" : !H && l || H && !l ? "left" : "right";
        b.setAttribute("style", "");
        f.setAttribute("style", "");
        b.style[d] = e + "px";
        f.style[d] = e + "px";
        k = N("yt-uix-card-arrow", c);
        b = N("yt-uix-card-arrow-background", c);
        k && b && (c =
            "right" == d ? Yf(c).width - e - 13 : e + 11, e = c / Math.sqrt(2), Jf(k, "left", c + "px"), Jf(k, "margin-left", "1px"), Jf(b, "margin-left", -e + "px"), Jf(b, "margin-top", e + "px"))
    }
    r.hide = function (a) {
        var b = this.Y(a);
        if (b && (a = Dh(this, a, b))) J(b, Z(this, "active")), J(a, Z(this, "card-visible")), Y(a), this.e = n, a.cardTargetNode = n, a.cardRootNode = n
    };

    function Gh(a) {
        a.e && a.hide(a.e)
    }

    function Fh(a, b) {
        var c = b.cardContentNode;
        if (!c) {
            var d = Z(a, "content"),
                e = Z(a, "card-content");
            (c = N(d, b)) || (c = document.createElement("div"));
            Lc(c, d, e);
            b.cardContentNode = c
        }
        return c
    };

    function Hh() {
        this.b = {}
    }
    y(Hh, Ch);
    da(Hh);
    r = Hh.prototype;
    r.X = "clickcard";
    r.register = function () {
        $(this, "click", this.Uh, "target");
        $(this, "click", this.Th, "close")
    };
    r.Uh = function (a) {
        var b = this.k(a, "card-target");
        a = b ? L(b) : a;
        b = this.Y(a);
        K(b, Z(this, "active")) ? (this.hide(a), J(b, Z(this, "active"))) : (this.show(a), I(b, Z(this, "active")))
    };
    r.show = function (a) {
        Ih(this);
        Hh.L.show.call(this, a);
        var b = this.Y(a);
        T(b, "click-outside-persists") || (this.g = a, this.i = U(document, "click", v(this.Ug, this)))
    };
    r.hide = function (a) {
        Hh.L.hide.call(this, a);
        this.i && V(this.i)
    };
    r.Ug = function (a) {
        Q(a.target, "yt-uix" + (this.X ? "-" + this.X : "") + "-card") || Ih(this)
    };

    function Ih(a) {
        a.g && (a.hide(a.g), a.g = n)
    }
    r.Th = function (a) {
        (a = Q(a, Z(this, "card"))) && this.hide(a.cardTargetNode)
    };

    function Jh() {
        this.b = {}
    }
    y(Jh, ih);
    da(Jh);
    Jh.prototype.X = "close";
    Jh.prototype.register = function () {
        $(this, "click", this.e)
    };
    Jh.prototype.e = function (a) {
        var b, c = this.k(a, "close-parent-class"),
            d = this.k(a, "close-parent-id");
        d ? b = L(d) : c && (b = Q(a, c));
        if (b && (Y(b), c = this.k(a, "close-focus-target-id"))) if (c = L(c)) d = oh.getInstance(), zh(d, c) && ph(d, c), c.focus();
        this.oa(a, "close-callback", b)
    };
    var Kh, Lh;

    function Mh(a) {
        var b, c = window.location.href,
            d = p,
            e, f, k, l = p;
        k = L("page");
        var q = K(k, "watch");
        a = a || n;
        if (!a && !q) return n;
        a && (f = Q(a, "context-data-container"));
        if (f) d = "true" == T(f, "context-open");
        else if (q && (f = L("watch-context-item-list")), !f) return n;
        var A = M("context-data-item", f);
        if (!A || !A.length) return n;
        if (q) {
            if (l = m, q = L("watch-context-container"), k = T(q, "context-type"), q = N("context-back-link", q)) c = q.href
        } else k = K(k, "search") ? "search" : K(k, "channel") ? "channel" : K(k, "home") ? "home" : K(k, "feed") ? "feed" : "default";
        f = T(f, "context-subsource");
        if (q = L("context-source-container")) e = T(q, "context-source"), b = T(q, "context-image");
        a = Nh(A, a);
        a.image = b;
        a.link = c;
        a.open = d;
        a.source = e;
        a.subsource = f;
        a.type = k;
        a.propagated = l;
        return a
    }
    function Nh(a, b) {
        var c = [],
            d = 0;
        z(a, function (a, e) {
            var l;
            switch (T(a, "context-item-type")) {
                case "playlist":
                    l = Oh(a);
                    break;
                case "video":
                    l = Ph(a)
            }
            l && (c.push(l), b && od(a, b) && (d = e))
        });
        var e = {};
        e.clickindex = d;
        e.items = c;
        return e
    }

    function Oh(a) {
        var b = {
            type: "playlist"
        };
        fb(Qh, function (c, d) {
            b[c] = T(a, d)
        });
        return b
    }
    function Ph(a) {
        var b = {
            type: "video"
        };
        fb(Rh, function (c, d) {
            b[c] = T(a, d)
        });
        return b
    }
    var Qh = {
        "context-item-actionuser": "actionuser",
        "context-item-actionuserurl": "actionuserurl",
        "context-item-actionuserthumb": "actionuserthumb",
        "context-item-actionverb": "actionverb",
        "context-item-count": "count",
        "context-item-count-label": "countlabel",
        "context-item-id": "id",
        "context-item-listthumb": "listthumb",
        "context-item-title": "title",
        "context-item-user": "user",
        "context-item-videos": "videos"
    }, Rh = {
            "context-item-actionuser": "actionuser",
            "context-item-actionuserthumb": "actionuserthumb",
            "context-item-actionuserurl": "actionuserurl",
            "context-item-actionverb": "actionverb",
            "context-item-id": "id",
            "context-item-time": "time",
            "context-item-title": "title",
            "context-item-user": "user",
            "context-item-videothumb": "videothumb",
            "context-item-views": "views"
        };

    function Sh(a, b) {
        return "videos" == a ? JSON.parse(b) : b
    };

    function Th() {
        this.b = {}
    }
    y(Th, ih);
    da(Th);
    Th.prototype.X = "contextlink";
    Th.prototype.register = function () {
        $(this, "click", this.e)
    };
    Th.prototype.e = function (a) {
        var b = a.href;
        if (b) {
            var c = ue(b);
            if (c == window.location.host || !c && 0 == b.lastIndexOf("/", 0)) if (c = we(b), c = xe(c)) {
                    c = Ee(b, "v");
                    if (!c) {
                        var d = (Ee(b, "video_ids") || "").split(",");
                        d && 1 < d.length && (b = parseInt(Ee(b, "index"), 10), c = 0 < b ? d[b] : d[0]);
                        if (!c) return
                    }(a = Mh(a)) && pf("context-" + c, a, 600)
                }
        }
    };

    function Uh() {
        this.b = {}
    }
    y(Uh, ih);
    da(Uh);
    r = Uh.prototype;
    r.X = "expander";
    r.register = function () {
        $(this, "click", this.ci, "head");
        $(this, "keypress", this.di, "head")
    };
    r.ci = function (a) {
        Vh(this, a)
    };
    r.di = function (a, b, c) {
        c && 13 == c.keyCode && Vh(this, a)
    };

    function Vh(a, b) {
        var c = a.Y(b);
        c && (Nc(c, Z(a, "collapsed")), a.oa(c, "expander-action"))
    }
    function Wh(a, b) {
        var c = a.Y(b);
        c && (I(c, Z(a, "collapsed")), a.oa(c, "expander-action"))
    }
    r.getBodyElement = function (a) {
        return N(Z(this, "body"), a)
    };
    var Xh = RegExp("^[^\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]"),
        Yh = RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]");

    function Zh() {
        this.b = {}
    }
    y(Zh, ih);
    da(Zh);
    r = Zh.prototype;
    r.X = "form-input";
    r.register = function () {
        G && !yc(9) && ($(this, "click", this.Pc, "checkbox"), $(this, "keypressed", this.Pc, "checkbox"), $(this, "click", this.Me, "radio"), $(this, "keypressed", this.Me, "radio"));
        G && !yc(10) && $(this, "click", this.xh, "placeholder");
        $(this, "change", this.Pc, "checkbox");
        $(this, "blur", this.vh, "select-element");
        $(this, "change", this.ib, "select-element");
        $(this, "keyup", this.ib, "select-element");
        $(this, "focus", this.wh, "select-element");
        $(this, "keyup", this.xd, "text");
        $(this, "keyup", this.xd, "textarea");
        $(this,
            "keyup", this.xd, "bidi");
        $(this, "click", this.yh, "reset")
    };
    r.Pc = function (a) {
        var b = Q(a, Z(this, "checkbox-container"));
        a.checked && K(b, "partial") && (a.checked = p, a.e = p, J(b, "partial"));
        Mc(b, "checked", a.checked)
    };
    r.mi = function (a) {
        var b = Q(a, Z(this, "radio-container"));
        b && Mc(b, "checked", a.checked)
    };
    r.Me = function () {
        $h()
    };
    r.xd = function (a) {
        var b = a.value,
            c = "";
        Yh.test(b) ? c = "rtl" : Xh.test(b) && (c = "ltr");
        a.dir = c;
        G && !yc(10) && (b = Q(a, Z(this, "container"))) && Mc(b, Z(this, "non-empty"), !! a.value)
    };
    r.xh = function (a) {
        a = Q(a, Z(this, "container"));
        (a = N(Z(this, "text"), a) || N(Z(this, "textarea"), a)) && a.focus()
    };
    r.wh = function (a) {
        var b = Q(a, Z(this, "select"));
        I(b, "focused");
        this.ib(a)
    };
    r.vh = function (a) {
        var b = Q(a, Z(this, "select"));
        J(b, "focused");
        this.ib(a)
    };
    r.ib = function (a) {
        var b = Q(a, Z(this, "select")),
            b = N(Z(this, "select-value"), b),
            c = a.options[Math.max(a.selectedIndex, 0)];
        c && ("" != b.innerHTML && c.innerHTML != b.innerHTML && this.oa(a, "onchange-callback"), b.innerHTML = c.innerHTML)
    };
    r.yh = function () {
        var a = Zh.getInstance(),
            b = M(Z(a, "checkbox"));
        z(b, a.Pc, a);
        $h();
        ai()
    };

    function bi() {
        ai()
    }
    function $h() {
        var a = Zh.getInstance(),
            b = M(Z(a, "radio"));
        z(b, a.mi, a)
    }
    function ai() {
        var a = Zh.getInstance(),
            b = M(Z(a, "select-element"));
        z(b, a.ib, a)
    };

    function ci() {
        this.b = {}
    }
    y(ci, Ch);
    da(ci);
    r = ci.prototype;
    r.X = "hovercard";
    r.register = function () {
        $(this, "mouseenter", this.Ih, "target");
        $(this, "mouseleave", this.Kh, "target");
        $(this, "mouseenter", this.Jh, "card");
        $(this, "mouseleave", this.Lh, "card")
    };
    r.Ih = function (a) {
        if (di != a) {
            di && (this.hide(di), di = n);
            var b = v(this.show, this, a),
                c = parseInt(this.k(a, "delay-show"), 10),
                b = D(b, -1 < c ? c : 200);
            S(a, "card-timer", b.toString());
            di = a;
            a.alt && (S(a, "card-alt", a.alt), a.alt = "");
            a.title && (S(a, "card-title", a.title), a.title = "")
        }
    };
    r.Kh = function (a) {
        var b = parseInt(this.k(a, "card-timer"), 10);
        Qb(b);
        this.Y(a).isCardHidable = m;
        b = parseInt(this.k(a, "delay-hide"), 10);
        D(v(this.nh, this, a), -1 < b ? b : 200);
        if (b = this.k(a, "card-alt")) a.alt = b;
        if (b = this.k(a, "card-title")) a.title = b
    };
    r.nh = function (a) {
        this.Y(a).isCardHidable && (this.hide(a), di = n)
    };
    r.Jh = function (a) {
        a && (a.cardRootNode.isCardHidable = p)
    };
    r.Lh = function (a) {
        a && this.hide(a.cardTargetNode)
    };
    var di = n;

    function ei() {
        this.b = {}
    }
    y(ei, ih);
    da(ei);
    r = ei.prototype;
    r.X = "legacy-slider";
    r.register = function () {
        $(this, "click", this.Gh, "num");
        $(this, "click", this.Hh, "prev");
        $(this, "click", this.Fh, "next");
        $(this, "mouseover", this.Mh, "ajax-trigger")
    };
    r.Gh = function (a) {
        if (a) {
            var b = this.Y(a);
            a = parseInt(this.k(a, "slider-num"), 10);
            if (isNaN(a) || 0 > a) a = 0;
            this.Lc(b, a)
        }
    };
    r.Fh = function (a, b, c) {
        if (a) {
            a = this.Y(a);
            if (K(a, Z(this, "fluid"))) {
                if (a) {
                    var d = this.getBodyElement(a);
                    b = fi(this, d);
                    var e = gi(this, b),
                        f = 0 < e.length;
                    b = parseInt(this.k(a, "slider-offset"), 10);
                    if (isNaN(b) || 0 < b) b = 0;
                    var k = hi(this, a);
                    f ? (d = ii(this, a, e), k = Math.floor(k / d), b = Math.abs(Math.floor(b / d)) - 1, ji(this, a, (0 <= b ? b : 0) + k)) : (e = ki(this, a) ? d.scrollHeight : d.scrollWidth, this.td && 8 > document.documentMode ? Math.abs(b - k) < e && (b -= k) : d.offsetWidth < e && (b -= k), li(this, a, b))
                }
            } else if (a) {
                b = parseInt(this.k(a, "slider-current"), 10);
                if (isNaN(b) || 0 > b) b = 0;
                d = parseInt(this.k(a, "slider-slides"), 10);
                if (isNaN(d) || 0 > d) d = 0;
                b = Math.min(b + 1, d - 1);
                this.Lc(a, b)
            }
            c.preventDefault()
        }
    };
    r.Hh = function (a, b, c) {
        if (a) {
            a = this.Y(a);
            if (K(a, Z(this, "fluid"))) {
                if (a) {
                    b = this.getBodyElement(a);
                    b = fi(this, b);
                    var d = gi(this, b),
                        e = 0 < d.length;
                    b = parseInt(this.k(a, "slider-offset"), 10);
                    if (isNaN(b) || 0 < b) b = 0;
                    var f = hi(this, a);
                    e ? (d = ii(this, a, d), f = Math.floor(f / d), b = Math.abs(Math.floor(b / d)) - 1, ji(this, a, (0 <= b ? b : 0) - f)) : (b += f, 0 < b && (b = 0), li(this, a, b))
                }
            } else if (a) {
                b = parseInt(this.k(a, "slider-current"), 10);
                if (isNaN(b) || 0 > b) b = 0;
                b = Math.max(b - 1, 0);
                this.Lc(a, b)
            }
            c.preventDefault()
        }
    };
    r.Mh = function (a) {
        if (a = this.Y(a)) {
            var b = Z(this, "ajax-trigger"),
                c = M(b, a);
            z(c, function (a) {
                J(a, b)
            });
            mi(this, a)
        }
    };

    function mi(a, b, c) {
        var d = a.k(b, "slider-ajax-url");
        d && !a.k(b, "slider-loaded") && (S(b, "slider-loaded", "true"), R(d, {
            R: a,
            B: function (a, d) {
                var k = ad(d.slides_html),
                    l = N(Z(this, "slides"), b);
                l && k && bd(l, k);
                c && c()
            }
        }))
    }
    function ki(a, b) {
        return K(b, Z(a, "vertical"))
    }
    function hi(a, b) {
        var c = a.getBodyElement(b);
        return ki(a, b) ? c.offsetHeight : c.offsetWidth
    }
    r.Lc = function (a, b) {
        a && (this.k(a, "slider-ajax-url") && !this.k(a, "slider-loaded") ? mi(this, a, v(this.Lc, this, a, b)) : ni(this, a, b))
    };

    function ni(a, b, c) {
        var d = Rc(n, Z(a, "num"), b),
            e = Z(a, "num-current"),
            f;
        z(d, function (a) {
            f = this.k(a, "slider-num") == c;
            Mc(a, e, f);
            K(a, "yt-uix-button") && Mc(a, "yt-uix-button-toggled", f)
        }, a);
        var d = N(Z(a, "slides"), b),
            k = ki(a, b);
        if (d) {
            var l = fi(a, d);
            if (l) {
                var q = -1 * c * (k ? l.offsetHeight : l.offsetWidth) + "px";
                k ? d.style.top = q : Rf(l) ? d.style.right = q : d.style.left = q
            }
        }
        if (d = N("yt-uix-pager-current-page", b)) d.innerHTML = c + 1;
        S(b, "slider-current", c + "");
        oi(a, b)
    }

    function oi(a, b) {
        if (b) {
            var c = parseInt(a.k(b, "slider-current"), 10),
                d = parseInt(a.k(b, "slider-slides"), 10),
                e = M(Z(a, "next"), b),
                f = M(Z(a, "prev"), b);
            z(e, function (a) {
                a.disabled = p
            });
            z(f, function (a) {
                a.disabled = p
            });
            0 == c && z(f, function (a) {
                a.disabled = m
            });
            c == d - 1 && z(e, function (a) {
                a.disabled = m
            })
        }
    }

    function ji(a, b, c) {
        if (b) {
            var d = a.getBodyElement(b),
                d = fi(a, d),
                e = gi(a, d);
            if (!(0 >= e.length)) {
                c >= e.length && (c = e.length - 1);
                var f = parseInt(a.k(b, "slider-offset"), 10);
                if (isNaN(f) || 0 < f) f = 0;
                var d = hi(a, b),
                    k = ii(a, b, e),
                    f = Math.abs(Math.floor(f / k)) - 1;
                if (c > (0 <= f ? f : 0)) {
                    var f = Math.floor(d / k),
                        l = e.length;
                    c + f > l && (c = l - f + 1)
                }
                0 > c && (c = 0);
                c = e[c];
                f = Rf(b) ? c.offsetLeft - d + k + 10 : -1 * (c.offsetLeft - 10);
                li(a, b, f)
            }
        }
    }

    function li(a, b, c) {
        if (b) {
            isNaN(c) && (c = 0);
            var d = a.getBodyElement(b),
                d = fi(a, d);
            a = Rc(n, Z(a, "title"), d);
            var e = Rf(b) ? "right" : "left";
            d.style[e] = c + "px";
            z(a, function (a) {
                a.style[e] = -1 * c + "px"
            });
            S(b, "slider-offset", c + "")
        }
    }
    r.getBodyElement = function (a) {
        return N(Z(this, "body"), a)
    };

    function fi(a, b) {
        return N(Z(a, "slide"), b)
    }
    function gi(a, b) {
        return Rc(n, Z(a, "slide-unit"), b)
    }

    function ii(a, b, c) {
        if (0 == c.length) return 0;
        a = ki(a, b);
        b = c[0];
        var d = a ? b.offsetHeight : b.offsetWidth;
        1 < c.length && (c = c[1], d = a ? c.offsetTop - b.offsetHeight : Rf(b) ? b.offsetLeft - c.offsetLeft : c.offsetLeft - b.offsetLeft);
        return d
    };

    function pi(a, b) {
        this.ua = a;
        this.g = p;
        this.e = new Fb;
        W(this.ua, "click", v(this.Hg, this), "yt-dialog-dismiss");
        qi(this, "content");
        this.i = b
    }
    var ri = {
        LOADING: "loading",
        qi: "content",
        Gk: "working"
    };

    function qi(a, b) {
        var c = N("yt-dialog-fg-content", a.ua),
            d = [];
        fb(ri, function (a) {
            d.push("yt-dialog-show-" + a)
        });
        Lc(c, d, "yt-dialog-show-" + b)
    }
    r = pi.prototype;
    r.show = function () {
        this.g || (si(this), this.g = m);
        document.activeElement && document.activeElement != document.body && document.activeElement.blur();
        this.b || (this.b = L("yt-dialog-bg"), this.b || (this.b = document.createElement("div"), this.b.id = "yt-dialog-bg", this.b.className = "yt-dialog-bg", document.body.appendChild(this.b)));
        var a = window,
            b = a.document,
            c = 0;
        if (b) {
            var a = Uc(a).height,
                c = b.body,
                d = b.documentElement;
            if (Vc(b) && d.scrollHeight) c = d.scrollHeight != a ? d.scrollHeight : d.offsetHeight;
            else {
                var b = d.scrollHeight,
                    e = d.offsetHeight;
                d.clientHeight != e && (b = c.scrollHeight, e = c.offsetHeight);
                c = b > a ? b > e ? b : e : b < e ? b : e
            }
        }
        this.b.style.height = c + "px";
        X(this.b);
        this.he();
        b = ti(this);
        ui(b);
        this.i || U(document, "keydown", v(this.Rd, this));
        b = this.ua;
        a = E("player-added", this.he, this);
        S(b, "player-ready-pubsub-key", a);
        X(this.ua);
        Gh(Hh.getInstance());
        Gh(ci.getInstance())
    };

    function vi() {
        var a = M("yt-dialog");
        return Oa(a, function (a) {
            return Kg(a)
        })
    }

    function si(a) {
        var b = oh.getInstance();
        a = M(Z(b, "menu"), a.ua);
        z(a, function (a) {
            a = Q(a.activeButtonNode || a.parentNode, Z(b));
            S(a, "button-menu-root-container", "yt-dialog-base")
        })
    }
    r.he = function () {
        function a(a) {
            Mc(a, "off-screen", !ng(a, c))
        }
        var b = document.getElementsByTagName("object"),
            c = this.ua;
        z(document.getElementsByTagName("embed"), a);
        z(b, a)
    };

    function wi() {
        function a(a) {
            J(a, "off-screen")
        }
        var b = document.getElementsByTagName("object");
        z(document.getElementsByTagName("embed"), a);
        z(b, a)
    }

    function ti(a) {
        var b = Rc("iframe", n, a.ua);
        z(b, function (a) {
            var b = T(a, "onload");
            b && (b = t(b)) && U(a, "load", b);
            if (b = T(a, "src")) a.src = b
        }, a);
        return Ya(b)
    }
    function ui(a) {
        z(document.getElementsByTagName("iframe"), function (b) {
            -1 == La(a, b) && I(b, "iframe-hid")
        })
    }
    function xi() {
        var a = M("iframe-hid");
        z(a, function (a) {
            J(a, "iframe-hid")
        })
    }
    r.Hg = function (a) {
        a = a.currentTarget;
        a.disabled || (a = T(a, "action") || "", yi(this, a))
    };

    function yi(a, b) {
        a.e.M("pre-all");
        a.e.M("pre-" + b);
        Y(a.ua);
        Gh(Hh.getInstance());
        Gh(ci.getInstance());
        vi() || (Y(a.b), wi(), xi());
        a.i || Bg(document, "keydown", v(a.Rd, a));
        var c = a.ua;
        if (c) {
            var d = T(c, "player-ready-pubsub-key");
            d && (Wb(d), fg(c, "player-ready-pubsub-key"))
        }
        a.e.M("post-all");
        a.e.M("post-" + b)
    }
    r.setTitle = function (a) {
        pd(N("yt-dialog-title", this.ua), a)
    };
    r.Rd = function (a) {
        27 == a.keyCode && yi(this, "cancel")
    };
    x("yt.ui.Dialog", pi);

    function zi() {
        this.b = {}
    }
    y(zi, ih);
    da(zi);
    r = zi.prototype;
    r.kb = n;
    r.ac = n;
    r.X = "overlay";
    r.register = function () {
        $(this, "click", this.bf, "target");
        $(this, "click", this.hide, "close");
        Ai(this)
    };
    r.bf = function (a) {
        if (!this.kb || !Kg(this.kb.ua)) {
            var b = this.Y(a);
            a = Bi(b, a);
            b || (b = a ? a.overlayParentNode : n);
            if (b && a) {
                var c = !! this.k(b, "disable-shortcuts") || p;
                this.kb = new pi(a, c);
                this.ac = b;
                var d = N("yt-dialog-fg", a);
                if (d) {
                    var e = this.k(b, "overlay-class") || "",
                        f = this.k(b, "overlay-style") || "default",
                        k = this.k(b, "overlay-shape") || "default";
                    I(d, e, Z(this, f), Z(this, k))
                }
                this.kb.show();
                Ai(this);
                c || (c = v(function (a) {
                    K(a.target, "yt-dialog-base") && Ci(this)
                }, this), a = N("yt-dialog-base", a), U(a, "click", c));
                this.oa(b, "overlay-shown");
                Gh(Hh.getInstance())
            }
        }
    };

    function Ai(a) {
        a.e || (a.e = E("yt-uix-overlay-hide", Di))
    }
    function Ci(a) {
        a.kb && (yi(a.kb, "overlayhide"), a.oa(a.ac, "overlay-hidden"), a.ac = n, a.kb = n)
    }
    function Bi(a, b) {
        var c;
        if (a) if (c = N("yt-dialog", a)) {
                var d = L("body-container");
                d && (d.appendChild(c), a.overlayContentNode = c, c.overlayParentNode = a)
            } else c = a.overlayContentNode;
            else b && (c = Q(b, "yt-dialog"));
        return c
    }

    function Ei() {
        var a = zi.getInstance();
        if (a.ac) a = N("yt-dialog-fg-content", a.ac.overlayContentNode);
        else a: {
                if (a = M("yt-dialog-fg-content")) for (var b = 0; b < a.length; b++) {
                        var c = Q(a[b], "yt-dialog");
                        if (Kg(c)) {
                            a = a[b];
                            break a
                        }
                }
                a = n
        }
        return a
    }
    r.hide = function () {
        F("yt-uix-overlay-hide")
    };

    function Di() {
        Ci(zi.getInstance())
    }
    r.show = function (a) {
        this.bf(a)
    };

    function Fi() {
        this.b = {}
    }
    y(Fi, ih);
    da(Fi);
    Fi.prototype.X = "redirect-link";
    Fi.prototype.register = function () {
        $(this, "click", this.e)
    };
    Fi.prototype.e = function (a) {
        if (!T(a, "redirect-href-updated")) {
            S(a, "redirect-href-updated", "true");
            var b = B("XSRF_REDIRECT_TOKEN"),
                c = B("XSRF_FIELD_NAME");
            if (b && c) {
                var d = {};
                d.q = a.href;
                d[c] = b;
                a.href = Ie("/redirect", d)
            }
        }
    };

    function Gi() {
        this.b = {}
    }
    y(Gi, ih);
    da(Gi);
    r = Gi.prototype;
    r.X = "scroller";
    r.register = function () {
        $(this, "mouseenter", this.Zh);
        $(this, "mouseleave", this.$h)
    };
    r.Zh = function (a) {
        var b = U(a, "mousewheel", v(this.Vh, this, a));
        S(a, "scroller-mousewheel-listener", b);
        b = U(a, "scroll", v(this.Wh, this, a));
        S(a, "scroller-scroll-listener", b)
    };
    r.$h = function (a) {
        V(this.k(a, "scroller-mousewheel-listener") || "");
        S(a, "scroller-mousewheel-listener", "");
        V(this.k(a, "scroller-scroll-listener") || "");
        S(a, "scroller-scroll-listener", "")
    };
    r.Vh = function (a, b) {
        b.preventDefault();
        b.wheelDeltaY && (a.scrollTop = a.scrollTop + b.wheelDeltaY)
    };
    r.Wh = function (a) {
        this.oa(a, "scroll-action")
    };

    function Hi(a) {
        if (!a.length) return 0;
        var b = a[0],
            c = b.offsetHeight;
        1 < a.length && (c = a[1].offsetTop - b.offsetTop);
        return c
    }

    function Ii(a, b, c) {
        if (b && !(isNaN(c) || 0 > c)) if (a = M(Z(a, "scroll-unit"), b), !(0 >= a.length)) {
                c >= a.length && (c = a.length - 1);
                var d = Hi(a),
                    e = b.offsetHeight,
                    f = Math.max(Math.floor(b.scrollTop / d), 0);
                c > f - 1 && (d = Math.floor(e / d), e = a.length, c + d > e && (c = e - d + 1));
                0 > c && (c = 0);
                c = a[c].offsetTop;
                b && !isNaN(c) && (0 > c && (c = 0), b.scrollTop = c, S(b, "scroller-offset", c + ""))
            }
    }

    function Ji(a, b) {
        if (!b) return [];
        var c = M(Z(a, "scroll-unit"), b);
        if (0 >= c.length) return [];
        var d = b.scrollTop,
            e = Hi(c),
            f = b.offsetHeight,
            k = Math.max(Math.floor(d / e), 0),
            d = Math.min(Math.ceil((d + f) / e), c.length);
        return ab(Ya(c), k, d)
    };

    function Ki(a) {
        this.b = a
    }
    var Li = /\s*;\s*/;
    r = Ki.prototype;
    r.set = function (a, b, c, d, e, f) {
        /[;=\s]/.test(a) && g(Error('Invalid cookie name "' + a + '"'));
        /[;\r\n]/.test(b) && g(Error('Invalid cookie value "' + b + '"'));
        fa(c) || (c = -1);
        e = e ? ";domain=" + e : "";
        d = d ? ";path=" + d : "";
        f = f ? ";secure" : "";
        c = 0 > c ? "" : 0 == c ? ";expires=" + (new Date(1970, 1, 1)).toUTCString() : ";expires=" + (new Date(w() + 1E3 * c)).toUTCString();
        this.b.cookie = a + "=" + b + e + d + c + f
    };
    r.get = function (a, b) {
        for (var c = a + "=", d = (this.b.cookie || "").split(Li), e = 0, f; f = d[e]; e++) {
            if (0 == f.lastIndexOf(c, 0)) return f.substr(c.length);
            if (f == a) return ""
        }
        return b
    };
    r.remove = function (a, b, c) {
        var d = fa(this.get(a));
        this.set(a, "", 0, b, c);
        return d
    };
    r.Ma = function () {
        return Mi(this).keys
    };
    r.ya = function () {
        return Mi(this).Pg
    };
    r.nb = function () {
        return !this.b.cookie ? 0 : (this.b.cookie || "").split(Li).length
    };
    r.clear = function () {
        for (var a = Mi(this).keys, b = a.length - 1; 0 <= b; b--) this.remove(a[b])
    };

    function Mi(a) {
        a = (a.b.cookie || "").split(Li);
        for (var b = [], c = [], d, e, f = 0; e = a[f]; f++) d = e.indexOf("="), -1 == d ? (b.push(""), c.push(e)) : (b.push(e.substring(0, d)), c.push(e.substring(d + 1)));
        return {
            keys: b,
            Pg: c
        }
    }
    var Ni = new Ki(document);
    Ni.e = 3950;

    function Oi(a, b, c) {
        Ni.set("" + a, b, c, "/", "youtube.com")
    }
    function Pi(a, b) {
        return Ni.get("" + a, b)
    }
    function Qi(a) {
        Ni.remove("" + a, "/", "youtube.com")
    };

    function Ri(a, b) {
        var c = ue(a);
        if (c == ue(window.location.href) || !c && 0 == a.lastIndexOf("/", 0)) if (c = we(a), c = xe(c)) {
                for (var d = 0, e = 0; e < c.length; ++e) d = 31 * d + c.charCodeAt(e), d %= 4294967296;
                c = "s_tempdata-" + d;
                d = b ? He(b) : "";
                Oi(c, d, 5)
            }
    };

    function Si() {
        this.b = {}
    }
    y(Si, ih);
    da(Si);
    Si.prototype.X = "sessionlink";
    Si.prototype.register = function () {
        $(this, "mousedown", this.e);
        $(this, "click", this.e)
    };
    Si.prototype.e = function (a) {
        Ti(a)
    };

    function Ti(a) {
        var b = T(a, "sessionlink-target") || a.href;
        b && (a = T(a, "sessionlink") || "", a = Fe(a), Ri(b, a))
    };

    function Ui(a) {
        var b = Ce("/signin?context=popup", "next", document.location.protocol + "//" + document.domain + "/post_login"),
            b = Ce(b, "feature", "sub_button");
        if (b = window.open(b, "loginPopup", "width=375,height=440,resizable=yes,scrollbars=yes", m)) {
            var c = E("LOGGED_IN", function (b) {
                Wb(B("LOGGED_IN_PUBSUB_KEY", c));
                a(b)
            });
            Mb("LOGGED_IN_PUBSUB_KEY", c);
            b.moveTo((screen.width - 375) / 2, (screen.height - 440) / 2)
        }
    }
    x("yt.pubsub.publish", F);

    function Vi() {
        this.b = {};
        this.e = []
    }
    y(Vi, ih);
    da(Vi);
    Vi.prototype.X = "subscription-button";
    Vi.prototype.register = function () {
        $(this, "click", this.ye);
        this.e.push(E("subscription-subscribe-loading", this.xe, this), E("subscription-subscribe-loaded", this.we, this), E("subscription-unsubscirbe-loading", this.xe, this), E("subscription-unsubscribe-loaded", this.we, this), E("subscription-subscribe-success", this.Xg, this), E("subscription-unsubscribe-success", this.Yg, this))
    };
    var Wi = {
        Rh: "yt-uix-button-subscription-container",
        Sh: "yt-subscription-button-disabled-mask-container",
        ph: "yt-uix-button-subscribe",
        qh: "yt-uix-button-subscribed",
        Ke: "hover-enabled"
    }, Xi = {
            pi: "channel-external-id",
            Ck: "href",
            We: "is-subscribed",
            Dk: "sessionlink",
            Ek: "style-type",
            Xe: "subscription-id",
            Fk: "target",
            Hk: "ypc-enabled",
            sh: "ypc-item-type",
            rh: "ypc-item-id",
            th: "ypc-offers-url"
        };
    r = Vi.prototype;
    r.ye = function (a) {
        var b = this.k(a, "href");
        if (b) a = this.k(a, "target") || "_self", window.open(b, a);
        else if (C("subscription_ajax")) {
            var b = this.k(a, "channel-external-id"),
                c = this.k(a, "sessionlink"),
                d;
            if (this.k(a, "ypc-enabled")) {
                d = this.k(a, Xi.sh);
                var e = this.k(a, Xi.rh),
                    f = this.k(a, Xi.th);
                d = {
                    itemType: d,
                    itemId: e,
                    offersUrl: f,
                    subscriptionElement: a
                }
            } else d = n;
            this.k(a, "is-subscribed") ? (e = this.k(a, "subscription-id"), F("subscription-unsubscribe", b, e, d, a, c)) : F("subscription-subscribe", b, d, a, c)
        } else Yi(this, a)
    };
    r.xe = function (a) {
        this.Qc(a, this.Ue, m)
    };
    r.we = function (a) {
        this.Qc(a, this.Ue, p)
    };
    r.Xg = function (a, b) {
        this.Qc(a, this.Ve, m, b)
    };
    r.Yg = function (a) {
        this.Qc(a, this.Ve, p)
    };
    r.Ve = function (a, b, c) {
        b ? (S(a, Xi.We, "true"), c && S(a, Xi.Xe, c)) : (fg(a, Xi.We), fg(a, Xi.Xe));
        Zi(this, a)
    };
    r.Ue = function (a, b) {
        var c = Q(a, Wi.Rh);
        Mc(c, Wi.Sh, b);
        a.disabled = b
    };

    function Zi(a, b) {
        var c = a.k(b, "style-type"),
            d = !! a.k(b, "is-subscribed"),
            c = "-" + c,
            e = Wi.qh + c;
        Mc(b, Wi.ph + c, !d);
        Mc(b, e, d);
        d ? D(function () {
            I(b, Wi.Ke)
        }, 1E3) : J(b, Wi.Ke)
    }

    function $i(a, b) {
        var c = M(Z(a));
        return Ma(c, function (a) {
            return b == this.k(a, "channel-external-id")
        }, a)
    }
    r.ii = function (a, b, c) {
        var d = ab(arguments, 2);
        z(a, function (a) {
            b.apply(this, Wa(a, d))
        }, this)
    };
    r.Qc = function (a, b, c) {
        var d = $i(this, a),
            d = Wa([d], ab(arguments, 1));
        this.ii.apply(this, d)
    };

    function Yi(a, b) {
        var c = v(function (a) {
            a.subscription_ajax && Ob("subscription_ajax", a.subscription_ajax);
            this.ye(b)
        }, a);
        Ui(c)
    };

    function aj(a, b, c) {
        window.location = Ie(a, b || {}) + (c || "")
    }

    function bj(a, b) {
        var c = b || {};
        c.target = c.target || a.target || "YouTube";
        c.width = c.width || 600;
        c.height = c.height || 600;
        var d = c;
        d || (d = {});
        var e = window,
            c = "undefined" != typeof a.href ? a.href : String(a),
            f = d.target || a.target,
            k = [],
            l;
        for (l in d) switch (l) {
                case "width":
                case "height":
                case "top":
                case "left":
                    k.push(l + "=" + d[l]);
                    break;
                case "target":
                case "noreferrer":
                    break;
                default:
                    k.push(l + "=" + (d[l] ? 1 : 0))
        }
        l = k.join(",");
        if (d.noreferrer) {
            if (d = e.open("", f, l)) G && -1 != c.indexOf(";") && (c = "'" + c.replace(/'/g, "%27") + "'"), d.opener =
                    n, c = va(c), d.document.write('<META HTTP-EQUIV="refresh" content="0; url=' + c + '">'), d.document.close()
        } else d = e.open(c, f, l);
        c = d;
        if (!c) return n;
        c.opener || (c.opener = window);
        c.focus();
        return c
    };

    function cj() {
        this.b = {}
    }
    y(cj, ih);
    da(cj);
    cj.prototype.X = "tile";
    cj.prototype.register = function () {
        $(this, "click", this.e)
    };
    cj.prototype.e = function (a, b, c) {
        if (!wd(c.target, "a") && !wd(c.target, "button") && (a = N(Z(this, "link"), a))) G && !yc(9) ? a.click() : (K(a, "yt-uix-sessionlink") && Ti(a), aj(a.href))
    };

    function dj() {
        this.b = {}
    }
    y(dj, ih);
    da(dj);
    r = dj.prototype;
    r.X = "tooltip";
    r.Mc = 0;
    r.register = function () {
        $(this, "mouseover", this.Ne);
        $(this, "mouseout", this.yd);
        $(this, "click", this.yd);
        $(this, "touchstart", this.Ch);
        $(this, "touchend", this.Qe);
        $(this, "touchcancel", this.Qe)
    };
    r.zd = function () {
        return !(this.td && 0 == wc.indexOf("6"))
    };
    r.Ne = function (a) {
        if (!(this.Mc && 1E3 > w() - this.Mc)) {
            var b = parseInt(this.k(a, "tooltip-hide-timer"), 10);
            b && (fg(a, "tooltip-hide-timer"), Qb(b));
            var b = v(function () {
                ej(this, a);
                fg(a, "tooltip-show-timer")
            }, this),
                c = parseInt(this.k(a, "tooltip-show-delay"), 10) || 0,
                b = D(b, c);
            S(a, "tooltip-show-timer", b.toString());
            a.title && (S(a, "tooltip-text", a.title), a.title = "")
        }
    };
    r.yd = function (a) {
        var b = parseInt(this.k(a, "tooltip-show-timer"), 10);
        b && (Qb(b), fg(a, "tooltip-show-timer"));
        b = v(function () {
            if (a) {
                var b = L(fj(this, a));
                b && (gj(b), fd(b), fg(a, "content-id"))
            }
            fg(a, "tooltip-hide-timer")
        }, this);
        b = D(b, 50);
        S(a, "tooltip-hide-timer", b.toString());
        if (b = this.k(a, "tooltip-text")) a.title = b
    };
    r.Ch = function (a, b) {
        this.Mc = 0;
        var c = eh(b, Z(this), n[0].target);
        this.Ne(c)
    };
    r.Qe = function (a, b) {
        this.Mc = w();
        var c = eh(b, Z(this), n[0].target);
        this.yd(c)
    };

    function hj(a, b, c) {
        S(b, "tooltip-text", c);
        a = a.k(b, "content-id");
        if (a = L(a)) a.innerHTML = c
    }

    function ej(a, b) {
        if (b) {
            var c = a.k(b, "tooltip-text") || b.title;
            if (c) {
                var d = L(fj(a, b));
                if (!d) {
                    d = document.createElement("div");
                    d.id = fj(a, b);
                    d.className = Z(a, "tip");
                    var e = document.createElement("div");
                    e.className = Z(a, "tip-body");
                    var f = document.createElement("div");
                    f.className = Z(a, "tip-arrow");
                    var k = document.createElement("div");
                    k.className = Z(a, "tip-content");
                    var l = ij(a, b),
                        q = fj(a, b, "content");
                    k.id = q;
                    S(b, "content-id", q);
                    e.appendChild(k);
                    l && d.appendChild(l);
                    d.appendChild(e);
                    d.appendChild(f);
                    (rg() || document.body).appendChild(d);
                    hj(a, b, c);
                    if ((c = parseInt(a.k(b, "tooltip-max-width"), 10)) && e.offsetWidth > c) e.style.width = c + "px", I(k, Z(a, "normal-wrap"));
                    k = K(b, Z(a, "reverse"));
                    jj(a, b, d, e, l, k) || jj(a, b, d, e, l, !k);
                    var A = Z(a, "tip-visible");
                    D(function () {
                        I(d, A)
                    }, 0)
                }
            }
        }
    }

    function jj(a, b, c, d, e, f) {
        Mc(c, Z(a, "tip-reverse"), f);
        var k = 0;
        f && (k = 1);
        var l = Yf(b);
        f = new Xb((l.width - 10) / 2, f ? l.height : 0);
        var q = Qf(b);
        nh(new Xb(q.x + f.x, q.y + f.y), c, k);
        k = Uc(window);
        q = Uf(c);
        c = Yf(d);
        var A = Math.floor(c.width / 2);
        e && (e.style.left = "3px", e.style.height = c.height + "px", e.style.width = c.width + "px");
        e = !! (k.height < q.y + l.height);
        l = !! (q.y < l.height);
        f = !! (q.x < A);
        k = !! (k.width < q.x + A);
        q = (c.width + 3) / -2 - -5;
        a = a.k(b, "force-tooltip-direction");
        if ("left" == a || f) q = -5;
        else if ("right" == a || k) q = 20 - c.width - 3;
        d.style.left =
            Math.floor(q) + "px";
        return !(e || l)
    }
    function fj(a, b, c) {
        a = Z(a) + ig(b);
        c && (a += "-" + c);
        return a
    }
    function ij(a, b) {
        var c = n;
        ec && K(b, Z(a, "masked")) && ((c = L("yt-uix-tooltip-shared-mask")) ? (c.parentNode.removeChild(c), X(c)) : (c = document.createElement("iframe"), c.src = 'javascript:""', c.id = "yt-uix-tooltip-shared-mask", c.className = Z(a, "tip-mask")));
        return c
    }

    function gj(a) {
        var b = L("yt-uix-tooltip-shared-mask"),
            c = b && xd(b, function (b) {
                return b == a
            }, p, 2);
        b && c && (b.parentNode.removeChild(b), Y(b), document.body.appendChild(b))
    };

    function kj() {
        var a = Pi("PREF");
        if (a) for (var a = unescape(a).split("&"), b = 0; b < a.length; b++) {
                var c = a[b].split("="),
                    d = c[0];
                (c = c[1]) && (lj[d] = c.toString())
        }
    }
    da(kj);
    var lj = t("yt.prefs.UserPrefs.prefs_") || {};
    x("yt.prefs.UserPrefs.prefs_", lj);

    function mj(a) {
        /^f([1-9][0-9]*)$/.test(a) && g("ExpectedRegexMatch: " + a)
    }
    function nj(a) {
        /^\w+$/.test(a) || g("ExpectedRegexMismatch: " + a)
    }
    function oj(a) {
        a = lj[a] !== h ? lj[a].toString() : n;
        return a != n && /^[A-Fa-f0-9]+$/.test(a) ? parseInt(a, 16) : n
    }
    kj.prototype.get = function (a, b) {
        nj(a);
        mj(a);
        var c = lj[a] !== h ? lj[a].toString() : n;
        return c != n ? c : b ? b : ""
    };
    kj.prototype.set = function (a, b) {
        nj(a);
        mj(a);
        b == n && g("ExpectedNotNull");
        lj[a] = b.toString()
    };

    function pj(a, b) {
        return !!((oj("f" + (Math.floor(b / 31) + 1)) || 0) & 1 << b % 31)
    }
    function qj(a, b) {
        var c = "f" + (Math.floor(a / 31) + 1),
            d = 1 << a % 31,
            e = oj(c) || 0,
            e = b ? e | d : e & ~d;
        0 == e ? delete lj[c] : (d = e.toString(16), lj[c] = d.toString())
    }
    kj.prototype.remove = function (a) {
        nj(a);
        mj(a);
        delete lj[a]
    };

    function rj() {
        var a = [],
            b;
        for (b in lj) a.push(b + "=" + escape(lj[b]));
        Oi("PREF", a.join("&"), 31536E4)
    }
    kj.prototype.clear = function () {
        lj = {}
    };
    var sj = {
        Uj: 0,
        Ii: 1,
        Be: 2,
        vj: 3,
        Ji: 4,
        vk: 5,
        xk: 6,
        uk: 7,
        sk: 8,
        tk: 9,
        wk: 10,
        rk: 11,
        ak: 12,
        $j: 13,
        Zj: 14,
        dj: 15,
        Ij: 16,
        Lj: 17,
        Mj: 18,
        Kj: 19,
        Jj: 20,
        bk: 21,
        Ni: 22,
        qk: 23,
        Mi: 24,
        ti: 25,
        Oi: 26,
        bj: 27,
        Xj: 28,
        Li: 29,
        Wj: 30,
        ik: 31,
        hk: 32,
        Zi: 33,
        fk: 34,
        ck: 35,
        dk: 36,
        ek: 37,
        gk: 38,
        wj: 39,
        Pj: 40,
        vi: 41,
        Oj: 42,
        xi: 43,
        Ae: 44,
        Qi: 45,
        Fj: 46,
        kk: 47,
        yk: 48,
        zk: 49,
        Bk: 50,
        Yj: 51,
        Ci: 52,
        Ei: 53,
        Gj: 54,
        rj: 55,
        Pi: 56,
        Vj: 57,
        Sj: 58,
        aj: 59,
        Cj: 60,
        sj: 61,
        xj: 62,
        wi: 63,
        nk: 64,
        zi: 65,
        yi: 66,
        yj: 67,
        Hi: 68,
        Ui: 69,
        lj: 70,
        Dj: 71,
        cj: 72,
        Tj: 73,
        zj: 74,
        Ce: 75,
        fi: 76,
        Nj: 77,
        Vi: 78,
        lk: 79,
        tj: 80,
        Di: 81,
        Bj: 82,
        mj: 83,
        oj: 84,
        nj: 85,
        pj: 86,
        qj: 87,
        Ai: 88,
        ri: 89,
        Bi: 90,
        Hj: 91,
        Ej: 92,
        Gi: 93,
        Ak: 94,
        Yi: 95,
        Xi: 96,
        $i: 97,
        uj: 98,
        Ri: 99,
        Aj: 100,
        fj: 101,
        ej: 102,
        hj: 103,
        ij: 104,
        gj: 105,
        mk: 106,
        gi: 107,
        Wi: 108,
        Rj: 109,
        hi: 110,
        jj: 111,
        kj: 112,
        Qj: 113,
        Ki: 114,
        pk: 115,
        ok: 116,
        jk: 117,
        Fi: 118,
        Ye: 119,
        Si: 120,
        Ti: 121
    };

    function tj(a) {
        var b = n;
        "transition" in a.style ? b = "transition-duration" : "webkitTransition" in a.style ? b = "-webkit-transition-duration" : "MozTransition" in a.style ? b = "-moz-transition-duration" : "OTransition" in a.style ? b = "-o-transition-duration" : "msTransition" in a.style && (b = "-ms-transition-duration");
        a = b ? (document.defaultView ? document.defaultView.getComputedStyle(a, n) : document.parentWindow.getComputedStyle(a, n)).getPropertyValue(b) : "0";
        return 1E3 * parseFloat(a)
    };
    var uj = {}, vj = {};

    function wj(a, b) {
        a = L(a);
        var c = b || la(a),
            d = uj[c];
        d && (uj[c] = Ma(d, function (b) {
            return b[0] != a
        }))
    }
    function xj(a) {
        a in uj && !vj[a] && (z(uj[a], function (a) {
            var c = a[0];
            a = a[1];
            c && "IMG" == c.tagName && (c.onload = "", c.src = a)
        }), uj[a] = [], vj[a] = m)
    };

    function yj() {
        var a;
        if (!(a = t("ytcsi.data_"))) a = {
                tick: {},
                info: {}
        }, x("ytcsi.data_", a);
        return a
    };
    var zj, Aj, Bj = 0,
        Cj = 0,
        Dj = 0,
        Ej = p,
        Fj = [];

    function Gj() {
        Cj = B("THUMB_DELAY_LOAD_BUFFER") || 0;
        Fj.push(E("page-init", Hj));
        Fj.push(E("page-resize", Ij));
        Fj.push(E("page-scroll", Jj))
    }
    function Kj() {
        Ej = p;
        Dj = Bj = Cj = 0;
        Aj = zj = n;
        Wb(Fj);
        Fj = []
    }
    function Hj(a, b) {
        Ej = m;
        zj = b;
        Aj = a;
        Bj = b.y + a.height + Cj;
        Lj();
        B("MEASURE_THUMBNAIL_DELAY_LOAD") && (yj().tick.tdl = w())
    }
    function Ij(a) {
        Aj = a;
        zj && Mj(zj.y + a.height + Cj)
    }
    function Jj(a) {
        zj = a;
        Aj && Mj(a.y + Aj.height + Cj)
    }

    function Mj(a) {
        var b = Dj,
            c = Math.abs(b - a);
        if (!b || 400 <= c) {
            c = Nj(a);
            for (b = Nj(b); b < c;) xj("thumb-group-" + c), c--;
            Dj = a
        }
    }
    function Oj(a) {
        Pj(function (a, c) {
            var d = T(a, "group-key");
            d && (wj(a, d), fg(a, "group-key"));
            a.src = c
        }, a)
    }
    function Lj(a, b) {
        Qj(a, b);
        if (Aj && zj) for (var c = Nj(zj.y + Aj.height + Cj); 0 <= c; c--) xj("thumb-group-" + c)
    }

    function Qj(a, b) {
        Ej && Pj(function (a, d) {
            var e = T(a, "group-key");
            if (!(T(a, "thumb-manual") || e && !b)) {
                e && wj(a, e);
                var e = "thumb-group-" + Nj(Ng(a).y),
                    f;
                f = L(a);
                var k = e || la(f);
                k in uj || (uj[k] = []);
                uj[k].push([f, d]);
                vj[k] = p;
                S(a, "group-key", e)
            }
        }, a)
    }
    function Pj(a, b) {
        var c = Rc("img", n, b);
        z(c, function (b) {
            var c = T(b, "thumb");
            c && a.call(s, b, c)
        })
    }
    function Nj(a) {
        return Math.ceil(Math.max(0, a - Bj) / 400)
    };

    function Rj(a) {
        if (!a.metaKey && !a.ctrlKey) {
            var b = a.target;
            if (!("INPUT" == b.tagName || "TEXTAREA" == b.tagName || "SELECT" == b.tagName || "EMBED" == b.tagName)) switch (a.keyCode) {
                    case 78:
                        a.shiftKey && F("player-shortcut-next");
                        break;
                    case 80:
                        a.shiftKey && F("player-shortcut-prev");
                        break;
                    case 106:
                        F("player-shortcut-rewind");
                        break;
                    case 108:
                        F("player-shortcut-fast-forward");
                        break;
                    case 107:
                        F("player-shortcut-play-pause")
            }
        }
    };
    var id;

    function Sj() {
        if (hd = L("playlist")) {
            var a = L("player");
            id && od(document, id) ? gd() : (a.previousElementSibling != h ? a.previousElementSibling : ld(a.previousSibling, p)) != hd && dd(hd, a);
            X(hd);
            id = n;
            Tj.push(U(L("watch7-playlist-bar-autoplay-button"), "click", Uj));
            Tj.push(U(L("watch7-playlist-scrollfloater-autoplay-toggle"), "click", Vj));
            Tj.push(U(L("watch7-playlist-bar-shuffle-button"), "click", Wj));
            Tj.push(U(L("watch7-playlist-bar-toggle-button"), "click", Xj));
            Tj.push(U(L("watch7-playlist-bar-next-button"), "click", function (a) {
                Ag(a,
                    "bf_next")
            }));
            Tj.push(U(L("watch7-playlist-bar-prev-button"), "click", function (a) {
                Ag(a, "bf_prev")
            }));
            a = L("watch7-playlist-tray");
            Tj.push(yg(a));
            Tj.push(W(a, "click", Yj, "yt-uix-button-playlist-remove-item"));
            Zj.push(E("navigate", ak));
            Zj.push(E("page-scroll", bk));
            Zj.push(E("player-ready", ck));
            Zj.push(E("player-state-change", dk));
            Zj.push(E("player-error", ek));
            Zj.push(E("player-shortcut-next", fk));
            Zj.push(E("player-shortcut-prev", gk));
            B("SKIP_TO_NEXT_VIDEO") && hk(5);
            ik = Ng(L("watch7-content")).y;
            jk();
            kk()
        } else fd(id)
    }

    function lk(a, b) {
        if (b) {
            var c = L("watch7-playlist-bar-autoplay-button");
            if (!zh(oh.getInstance(), c) || mk) return
        }
        c = L("watch7-playlist-bar-next-button");
        nk(c.href, a || "bf_next", b);
        window.yt.spf ? t("spf.navigate")(c.href) : aj(c.href)
    }
    function kk() {
        var a = L("watch7-playlist-tray"),
            a = Ji(Gi.getInstance(), a);
        z(a, function (a) {
            Oj(a)
        })
    }
    function ck(a) {
        var b = B("LIST_END_TIME");
        b || (b = a.getDuration());
        for (var c = 5; 0 < c; c--) a.addCueRange("NEAR_END" + c, b - c, b - c + 1);
        a.addEventListener("onCueRangeEnter", ok)
    }

    function ok(a) {
        "NEAR_END" == a.slice(0, -1) && (pk(), a = parseInt(a.slice(-1), 10), qk(a))
    }
    function hk(a, b) {
        var c = b || "mr_meh";
        pk();
        rk ? sk = D(function () {
            hk(a, c)
        }, 1E3) : (qk(a), 0 == a ? lk(c, m) : sk = D(function () {
            hk(a - 1, c)
        }, 1E3))
    }
    function tk() {
        var a = L("watch7-playlist-data");
        return !!(a && "False" != T(a, "shareable"))
    }
    function Uj() {
        var a = L("watch7-playlist-bar-autoplay-button"),
            a = zh(oh.getInstance(), a);
        kj.getInstance();
        qj(sj.fi, a);
        rj();
        Mb("LIST_AUTO_PLAY_ON", !a)
    }

    function Vj() {
        var a = B("PLAYER_REFERENCE");
        a && a.getPlayerState ? 1 == a.getPlayerState() ? a.pauseVideo() : a.playVideo() : (Nc(hd, "paused"), rk = !rk)
    }
    function Wj() {
        var a = L("watch7-playlist-tray"),
            b = Ya(a.getElementsByTagName("li")),
            c = L("watch7-playlist-bar-shuffle-button");
        zh(oh.getInstance(), c) ? (b = uk(b), Mb("SHUFFLE_VALUE", 0)) : (c = vk(b), b = wk(b, c));
        cd(a);
        z(b, function (b) {
            a.appendChild(b)
        });
        c = B("SHUFFLE_VALUE");
        xk(b, c);
        jk();
        kk()
    }

    function Xj() {
        if (!Nc(L("watch7-container"), "watch-playlist-collapsed")) {
            var a = tj(L("watch7-playlist-tray-container"));
            D(kk, a)
        }
    }
    function Ag(a, b) {
        var c = a.currentTarget.href,
            d = b || "BFa",
            e = {}, f = B("SHUFFLE_VALUE");
        f ? e.shuffle = f : -1 != c.indexOf("shuffle=") && (e.shuffle = 0);
        e && (c = Ke(c, e));
        a.currentTarget.href = c;
        nk(c, d)
    }

    function Yj(a) {
        var b = L("watch7-playlist-data"),
            c = Q(a.currentTarget, "video-list-item");
        if (b && c) {
            var d = L("watch7-playlist-tray");
            I(d, "playlist-editing-locked");
            a = T(b, "full-list-id");
            var b = T(c, "video-id"),
                e = T(c, "index");
            R("/addto_ajax?action_delete_from_playlist=1", {
                format: "XML",
                method: "POST",
                F: {
                    video_ids: b,
                    session_token: C("addto_ajax") || "",
                    playlist_id: a,
                    index: e - 1
                },
                B: function () {
                    fd(c);
                    var a = Rc("li", "video-list-item", d),
                        b = 1,
                        e = 0;
                    z(a, function (a) {
                        if (K(a, "playlist-bar-item-playing")) e = b;
                        else {
                            var c = Rc("span",
                                "count", a);
                            c && c[0] && (c[0].innerHTML = b)
                        }
                        S(a, "index", b);
                        b += 1
                    });
                    L("watch7-playlist-current-index").innerHTML = e;
                    L("watch7-playlist-length").innerHTML = b - 1;
                    xk(a, B("SHUFFLE_VALUE"))
                },
                da: function () {
                    J(d, "playlist-editing-locked")
                }
            })
        }
    }
    function dk(a) {
        0 == a && lk("autoplay", m);
        yk && (2 == a ? I(hd, "paused") : 1 == a && J(hd, "paused"))
    }
    function ek(a) {
        switch (a) {
            case 5:
                hk(5, "html5_ns")
        }
    }
    function fk() {
        lk("keys")
    }

    function gk() {
        var a = L("watch7-playlist-bar-prev-button");
        nk(a.href, "keys");
        window.yt.spf ? t("spf.navigate")(a.href) : aj(a.href)
    }
    function bk(a) {
        yk && (a.y > ik ? I(hd, "scrolled") : a.y < ik - 50 && J(hd, "scrolled"))
    }
    function ak() {
        mk = m
    }

    function wk(a, b) {
        function c(a) {
            var c = 0,
                d = [];
            for (a = a.split(""); a.length;) {
                var c = (b + c) % a.length,
                    e = a[c];
                Ka.splice.call(a, c, 1);
                d.push(e)
            }
            return d.join("")
        }
        bb(a, function (a, b) {
            var d = T(a, "video-id"),
                e = T(b, "video-id");
            return c(d).localeCompare(c(e))
        });
        var d = b >> 8,
            e = Ra(a, function (a) {
                a = T(a, "index");
                return d == a
            }) || 0;
        0 < e && (a = ab(a, e).concat(ab(a, 0, e)));
        return a
    }
    function uk(a) {
        bb(a, function (a, c) {
            var d = parseInt(T(a, "index"), 10),
                e = parseInt(T(c, "index"), 10);
            return d - e
        });
        return a
    }

    function vk(a) {
        var b = B("SHUFFLE_VALUE");
        if (!b) {
            var c = 0;
            z(a, function (a) {
                K(a, "playlist-bar-item-playing") && (c = T(a, "index"))
            });
            b = (c << 8) + Math.floor(256 * Math.random());
            Mb("SHUFFLE_VALUE", b)
        }
        return b
    }

    function xk(a, b) {
        var c = n;
        z(a, function (a) {
            K(a, "playlist-bar-item-playing") && (c = a)
        });
        if (c) {
            var d = c.nextElementSibling != h ? c.nextElementSibling : ld(c.nextSibling, m);
            d || (d = a[0]);
            var e = c.previousElementSibling != h ? c.previousElementSibling : ld(c.previousSibling, p);
            e || (e = a[a.length - 1]);
            var f = L("watch7-playlist-bar-next-button"),
                k = L("watch7-playlist-bar-prev-button");
            f && d && (d = {
                v: T(d, "video-id")
            }, b ? d.shuffle = b : -1 != f.href.indexOf("shuffle=") && (d.shuffle = 0), f.href = Ke(f.href, d));
            k && e && (d = {
                v: T(e, "video-id")
            }, b ? d.shuffle =
                b : -1 != k.href.indexOf("shuffle=") && (d.shuffle = 0), k.href = Ke(k.href, d))
        }
    }
    function nk(a, b, c) {
        var d = B("EVENT_ID");
        d && (d = {
            ei: d
        }, b && (d.feature = b), (b = B("SHUFFLE_VALUE")) && (d.shuffle = b), c && (d.playnext = B("LIST_AUTO_PLAY_VALUE")), Ri(a, d));
        if (a = Ee(a, "v"))(c = Mh()) && pf("context-" + a, c, 600)
    }
    function qk(a) {
        S(hd, "autoplay-countdown", a)
    }
    function jk() {
        var a = L("watch7-playlist-tray"),
            b = N("playlist-bar-item-playing", a);
        if (b) {
            var c = Gi.getInstance();
            if (a && b) {
                var d = M(Z(c, "scroll-unit"), a),
                    b = La(d, b);
                0 <= b && Ii(c, a, b)
            }
        }
    }

    function pk() {
        if (yk != m) {
            var a = L("watch7-playlist-bar-autoplay-button");
            if (zh(oh.getInstance(), a)) {
                yk = m;
                Mc(hd, "playlist-floating", m);
                var b = document,
                    a = b.body,
                    b = b.documentElement;
                bk(new Xb(a.scrollLeft || b.scrollLeft, a.scrollTop || b.scrollTop))
            }
        }
    }
    var Tj = [],
        Zj = [],
        yk = p,
        rk = p,
        mk = p,
        ik = n,
        hd = n,
        sk = n;

    function zk(a) {
        var b = 0; - 1 != a.indexOf("h") && (a = a.split("h"), b = 3600 * a[0], a = a[1]); - 1 != a.indexOf("m") && (a = a.split("m"), b = 60 * a[0] + b, a = a[1]); - 1 != a.indexOf("s") ? (a = a.split("s"), b = 1 * a[0] + b) : b = 1 * a + b;
        return b
    }
    function Ak() {
        var a = N("yt-uix-button-toggled", L("action-panel-share"));
        return tk() && a ? T(a, "video-id") : B("VIDEO_ID")
    }
    function Bk() {
        var a = n;
        if (tk()) {
            var b = L("share-with-playlist");
            if (!b || b && b.checked) a = (a = L("watch7-playlist-data")) ? T(a, "full-list-id") : ""
        }
        return a
    }

    function Ck() {
        return B("PLAYER_REFERENCE")
    }
    function Dk(a) {
        var b = 0,
            c = Ck();
        c && c.pauseVideo && (c.pauseVideo(), b = c.getCurrentTime());
        b = Math.floor(b);
        c = Math.floor(b / 60);
        R("/watch_ajax", {
            method: "GET",
            G: {
                action_get_report_video_component: 1,
                video_id: B("VIDEO_ID"),
                t_mins: c,
                t_secs: b - 60 * c
            },
            B: function (b, c) {
                a(c.report_html, m)
            },
            onError: function () {
                a(n, p)
            }
        })
    }

    function Ek(a) {
        R("/insight_ajax", {
            format: "XML",
            method: "GET",
            G: {
                action_get_statistics_and_data: 1,
                v: B("VIDEO_ID")
            },
            B: function (b, c) {
                a(c.html_content, m)
            },
            onError: function () {
                a(n, p)
            }
        })
    }
    function Fk(a) {
        "true" != T(a, "loaded") && (S(a, "loaded", "true"), R("/watch_ajax", {
            format: "XML",
            G: {
                action_get_video_attributions_component: 1,
                v: B("VIDEO_ID")
            },
            B: function (b, c) {
                a.innerHTML = c.html_content
            }
        }))
    };

    function Gk(a, b) {
        this.b = new pi(a, m);
        this.i = b;
        this.o = this.e = this.$ = ""
    }
    var Hk = [],
        Ik = [],
        Jk = n;

    function Kk() {
        Hk.push(E("SHOW-COMMENT-DIALOG", Lk));
        Hk.push(E("SHOW-FAVORITE-DIALOG", Mk));
        Hk.push(E("SHOW-LIKE-DIALOG", Nk));
        Hk.push(E("SHOW-SUBSCRIBE-DIALOG", Ok))
    }
    function Pk(a, b, c, d) {
        var e = L("feed-privacy-lb");
        e && (Jk = new Gk(e, a), Jk.$ = b || "", Jk.o = c || "", Jk.e = d || "", a = Jk, Bb(B("FEED_PRIVACY_CSS_URL")), Qk(a, n, {
            channel_id: a.e,
            setting_type: a.i,
            time_created: a.o,
            video_id: a.$
        }))
    }

    function Ok(a) {
        Pk("SUBSCRIPTIONS", h, h, a)
    }
    function Lk(a, b) {
        Pk("COMMENTS", a, b)
    }
    function Nk(a) {
        Pk("LIKES", a)
    }
    function Mk(a) {
        Pk("FAVORITES", a)
    }
    function Rk() {
        Wb(Hk);
        Hk = [];
        V(Ik);
        Ik = []
    }
    function Qk(a, b, c) {
        b = b || {};
        c = c || {};
        c.session_token = C("feed_privacy_ajax");
        a = {
            method: "POST",
            format: "XML",
            G: b,
            F: c,
            B: v(a.j, a),
            onError: v(a.A, a)
        };
        R("/feed_privacy_ajax", a)
    }
    Gk.prototype.j = function (a) {
        var b = Se(a);
        a = Ve(b, "invalid_request");
        var c = Ve(b, "missing_setting_type"),
            d = Ve(b, "already_seen_dialog");
        if (!a && !c && !d) if (a = L("feed-privacy-dialog"), c = Ck(), d = Ve(b, "success_message")) {
                var e = L("alerts"),
                    b = Ve(b, "alert_template"),
                    f = document.createElement("div");
                f.innerHTML = b;
                b = kd(f);
                if (e) {
                    b.removeAttribute("id");
                    J(b, "yt-alert-warn");
                    I(b, "yt-alert-success");
                    var f = N("yt-alert-message", b),
                        k = N("yt-alert-content", b);
                    (f || k).innerHTML = d;
                    e.appendChild(b);
                    X(b)
                }
                for (var l in ug) ug[l][0] ==
                        a && V(l);
                window.scroll(0, 0);
                yi(this.b, "cancel");
                c && c.playVideo && c.playVideo()
            } else c && c.pauseVideo && c.pauseVideo(), a.innerHTML = Ve(b, "html_content"), Ik.push(W(a, "click", v(this.g, this, p), "make-activity-public-button")), Ik.push(W(a, "click", v(this.g, this, m), "make-activity-private-button")), Oj(a), qi(this.b, "content"), this.b.show()
    };
    Gk.prototype.A = function () {
        yi(this.b, "cancel")
    };
    Gk.prototype.g = function (a) {
        var b = {};
        b[a ? "action_make_private" : "action_make_public"] = "1";
        a = {
            setting_type: this.i
        };
        qi(this.b, "working");
        Qk(this, b, a)
    };

    function Sk(a, b) {
        var c;
        if (a instanceof Sk) this.fb = fa(b) ? b : a.fb, Tk(this, a.Eb), this.Ec = a.Ec, Uk(this, a.Db), Vk(this, a.Vb), this.Wb = a.Wb, Wk(this, a.b.N()), this.Dc = a.Dc;
        else if (a && (c = se(String(a)))) {
            this.fb = !! b;
            Tk(this, c[1] || "", m);
            var d = c[2] || "";
            this.Ec = d ? decodeURIComponent(d) : "";
            Uk(this, c[3] || "", m);
            Vk(this, c[4]);
            this.Wb = (d = c[5] || "") ? decodeURIComponent(d) : "";
            Wk(this, c[6] || "", m);
            this.Dc = (c = c[7] || "") ? decodeURIComponent(c) : ""
        } else this.fb = !! b, this.b = new Xk(n, 0, this.fb)
    }
    r = Sk.prototype;
    r.Eb = "";
    r.Ec = "";
    r.Db = "";
    r.Vb = n;
    r.Wb = "";
    r.Dc = "";
    r.fb = p;
    r.toString = function () {
        var a = [],
            b = this.Eb;
        b && a.push(Yk(b, Zk), ":");
        if (b = this.Db) {
            a.push("//");
            var c = this.Ec;
            c && a.push(Yk(c, Zk), "@");
            a.push(encodeURIComponent(String(b)));
            b = this.Vb;
            b != n && a.push(":", String(b))
        }
        if (b = this.Wb) this.Db && "/" != b.charAt(0) && a.push("/"), a.push(Yk(b, "/" == b.charAt(0) ? $k : al));
        (b = this.b.toString()) && a.push("?", b);
        (b = this.Dc) && a.push("#", Yk(b, bl));
        return a.join("")
    };
    r.N = function () {
        return new Sk(this)
    };

    function Tk(a, b, c) {
        a.Eb = c ? b ? decodeURIComponent(b) : "" : b;
        a.Eb && (a.Eb = a.Eb.replace(/:$/, ""))
    }
    function Uk(a, b, c) {
        a.Db = c ? b ? decodeURIComponent(b) : "" : b
    }
    function Vk(a, b) {
        b ? (b = Number(b), (isNaN(b) || 0 > b) && g(Error("Bad port number " + b)), a.Vb = b) : a.Vb = n
    }
    function Wk(a, b, c) {
        b instanceof Xk ? (a.b = b, cl(a.b, a.fb)) : (c || (b = Yk(b, dl)), a.b = new Xk(b, 0, a.fb))
    }
    function el(a, b, c) {
        a.b.set(b, c)
    }
    function fl(a, b, c) {
        ga(c) || (c = [String(c)]);
        gl(a.b, b, c)
    }

    function hl(a) {
        el(a, "zx", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ w()).toString(36));
        return a
    }
    function il(a, b, c, d) {
        var e = new Sk(n, h);
        a && Tk(e, a);
        b && Uk(e, b);
        c && Vk(e, c);
        d && (e.Wb = d);
        return e
    }
    function Yk(a, b) {
        return u(a) ? encodeURI(a).replace(b, jl) : n
    }
    function jl(a) {
        a = a.charCodeAt(0);
        return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16)
    }
    var Zk = /[#\/\?@]/g,
        al = /[\#\?:]/g,
        $k = /[\#\?]/g,
        dl = /[\#\?@]/g,
        bl = /#/g;

    function Xk(a, b, c) {
        this.b = a || n;
        this.e = !! c
    }

    function kl(a) {
        if (!a.T && (a.T = new Hd, a.J = 0, a.b)) for (var b = a.b.split("&"), c = 0; c < b.length; c++) {
                var d = b[c].indexOf("="),
                    e = n,
                    f = n;
                0 <= d ? (e = b[c].substring(0, d), f = b[c].substring(d + 1)) : e = b[c];
                e = ua(e);
                e = ll(a, e);
                a.add(e, f ? ua(f) : "")
        }
    }
    r = Xk.prototype;
    r.T = n;
    r.J = n;
    r.nb = function () {
        kl(this);
        return this.J
    };
    r.add = function (a, b) {
        kl(this);
        this.b = n;
        a = ll(this, a);
        var c = this.T.get(a);
        c || this.T.set(a, c = []);
        c.push(b);
        this.J++;
        return this
    };
    r.remove = function (a) {
        kl(this);
        a = ll(this, a);
        return Jd(this.T.e, a) ? (this.b = n, this.J -= this.T.get(a).length, this.T.remove(a)) : p
    };
    r.clear = function () {
        this.T = this.b = n;
        this.J = 0
    };

    function ml(a, b) {
        kl(a);
        b = ll(a, b);
        return Jd(a.T.e, b)
    }
    r.Ma = function () {
        kl(this);
        for (var a = this.T.ya(), b = this.T.Ma(), c = [], d = 0; d < b.length; d++) for (var e = a[d], f = 0; f < e.length; f++) c.push(b[d]);
        return c
    };
    r.ya = function (a) {
        kl(this);
        var b = [];
        if (a) ml(this, a) && (b = Wa(b, this.T.get(ll(this, a))));
        else {
            a = this.T.ya();
            for (var c = 0; c < a.length; c++) b = Wa(b, a[c])
        }
        return b
    };
    r.set = function (a, b) {
        kl(this);
        this.b = n;
        a = ll(this, a);
        ml(this, a) && (this.J -= this.T.get(a).length);
        this.T.set(a, [b]);
        this.J++;
        return this
    };
    r.get = function (a, b) {
        var c = a ? this.ya(a) : [];
        return 0 < c.length ? String(c[0]) : b
    };

    function gl(a, b, c) {
        a.remove(b);
        0 < c.length && (a.b = n, a.T.set(ll(a, b), Ya(c)), a.J += c.length)
    }
    r.toString = function () {
        if (this.b) return this.b;
        if (!this.T) return "";
        for (var a = [], b = this.T.Ma(), c = 0; c < b.length; c++) for (var d = b[c], e = encodeURIComponent(String(d)), d = this.ya(d), f = 0; f < d.length; f++) {
                var k = e;
                "" !== d[f] && (k += "=" + encodeURIComponent(String(d[f])));
                a.push(k)
        }
        return this.b = a.join("&")
    };
    r.N = function () {
        var a = new Xk;
        a.b = this.b;
        this.T && (a.T = this.T.N(), a.J = this.J);
        return a
    };

    function ll(a, b) {
        var c = String(b);
        a.e && (c = c.toLowerCase());
        return c
    }

    function cl(a, b) {
        b && !a.e && (kl(a), a.b = n, Gd(a.T, function (a, b) {
            var e = b.toLowerCase();
            b != e && (this.remove(b), gl(this, e, a))
        }, a));
        a.e = b
    };

    function nl() {
        this.K = this.o = "";
        this.C = n;
        this.j = this.g = p;
        this.A = n;
        this.ba = this.ga = this.U = ""
    }
    r = nl.prototype;
    r.le = function () {
        return m
    };
    r.Sg = function () {};
    r.de = function () {};
    r.close = function (a) {
        this.j = p;
        yi(this.e, a || "close");
        this.Sg()
    };
    r.create = function (a, b, c, d) {
        this.j && (b && (this.C = b), c && (this.A = c), a && !this.g ? this.Tg({}, d) : this.qd())
    };
    r.open = function (a, b, c, d, e, f, k, l, q) {
        this.o = a;
        this.U = b;
        this.ga = c;
        if (this.le()) {
            a: {
                if (this.g) this.g && ol(this);
                else {
                    this.i = L(this.o + "-lb");
                    if (!this.i) break a;
                    this.e = new pi(this.i, l)
                }
                pl(this, "loading");
                try {
                    this.e.setTitle("")
                } catch (A) {}
                this.e.show();
                this.j = m
            }
            d && this.create(e, f, k, q)
        }
    };
    r.Tg = function (a, b, c, d, e) {
        arguments.length && pl(this, "loading");
        e && pl(this, e);
        var f = v(this.Zg, this, c || n),
            k = a || {};
        this.C && (k.feature = this.C);
        this.A && (k.next = this.A);
        var l = b || {};
        l.session_token = C(this.ga);
        f = {
            format: "XML",
            method: "POST",
            onError: d || v(this.ze, this),
            B: f || ca,
            F: l,
            G: k
        };
        R(this.U, f)
    };

    function pl(a, b) {
        switch (b) {
            case "content":
                qi(a.e, "content");
                break;
            case "loading":
                qi(a.e, "loading");
                break;
            case "working":
                qi(a.e, "working")
        }
    }
    function ol(a, b) {
        if (a.g) {
            var c = b || a.ba;
            c && (Lc(a.b, a.K, c), a.K = c)
        }
    }
    r.qd = function (a) {
        a && (L(this.o + "-dialog").innerHTML = a);
        this.b = N("yt-dialog-fg", this.i);
        a = N("yt-pd-params", this.i);
        this.ba = T(a, "start-page") || "";
        W(this.b, "click", v(this.Zf, this), "yt-pd-close");
        W(this.b, "click", v(this.Yf, this), "yt-pd-setclass");
        W(this.b, "click", v(this.$f, this), "yt-pd-setpage");
        this.de();
        pl(this, "content");
        this.g = m;
        ol(this)
    };
    r.Zf = function () {
        this.close("cancel")
    };
    r.Yf = function (a) {
        a = Q(a.target, "yt-pd-setclass");
        var b = T(a, "off");
        b && Mc(this.b, b, p);
        (a = T(a, "on")) && Mc(this.b, a, m)
    };
    r.$f = function (a) {
        a = Q(a.target, "yt-pd-setpage");
        (a = T(a, "state-container-id")) && ol(this, a)
    };
    r.ze = function () {
        this.close()
    };
    r.Zg = function (a, b) {
        var c = Se(b);
        if (c) {
            var d = Ve(c, "not_eligible"),
                e = Ve(c, "error_message");
            if (d || e) this.ze();
            else {
                if (b) {
                    d = b.redirect_url;
                    if (!d) try {
                            d = Ve(Se(b), "redirect_url")
                    } catch (f) {
                        d = n
                    }
                    d ? (aj(d), d = m) : d = p
                } else d = p;
                d || (c = Ve(c, "html_content") || h, a ? a(b, v(this.qd, this, c)) : this.qd(c))
            }
        }
    };
    var ql = [];

    function rl() {
        nl.call(this);
        Bb(B("IDENTITY_PROMPT_CSS_URL"))
    }
    y(rl, nl);

    function sl() {
        var a = la(rl);
        ql[a] || (ql[a] = new rl);
        ql[a].open("identity-prompt", "/identity_prompt_ajax", "identity_prompt_ajax", m, m, h, B("IDENTITY_PROMPT_NEXT_URL", document.location.href), m)
    }
    rl.prototype.le = function () {
        var a = Ck();
        a && a.pauseVideo && a.pauseVideo();
        return m
    };
    rl.prototype.de = function () {
        W(this.b, "click", v(this.pa, this), "identity-prompt-account-list-item")
    };
    rl.prototype.pa = function () {
        L("identity-prompt-confirm-button").disabled = p
    };

    function tl(a) {
        this.g = p;
        this.e = n;
        this.b = [];
        a ? (this.o(), this.i()) : (a = L("body-container"), this.b.push(W(a, "mousedown", v(this.o, this), "create-channel-lightbox")), this.b.push(W(a, "click", v(this.i, this), "create-channel-lightbox")))
    }
    var ul;

    function vl() {
        ul = new tl
    }
    function wl() {
        ul.ma()
    }
    tl.prototype.ma = function () {
        V(this.b);
        this.b = []
    };
    tl.prototype.o = function () {
        this.g || (Bb(B("CREATE_CHANNEL_CSS_URL")), Ab(B("CREATE_CHANNEL_JS_URL"), v(function () {
            this.g = m;
            this.e && xl(this, this.e)
        }, this)))
    };
    tl.prototype.j = function () {
        var a = B("CREATE_CHANNEL_NEXT_URL");
        a && ("/" == a ? aj(a) : window.history.back())
    };
    tl.prototype.i = function (a) {
        var b = "default";
        if (a && (a = T(a.currentTarget, "upsell"), "settings" == a || "upload" == a || "playlist" == a || "guide" == a || "comment" == a)) b = a;
        xl(this, b)
    };

    function xl(a, b) {
        if (a.g) {
            var c;
            switch (b) {
                case "settings":
                    c = "/profile";
                    break;
                case "guide":
                    c = B("CREATE_CHANNEL_NEXT_URL_GUIDE");
                    break;
                case "upload":
                    c = B("CREATE_CHANNEL_NEXT_URL_UPLOAD");
                    break;
                default:
                    c = document.location.href
            }
            B("CREATE_CHANNEL_NEXT_URL") && (c = B("CREATE_CHANNEL_NEXT_URL"));
            var d = {
                method: "POST",
                G: {
                    action_get_type: 1
                },
                F: {
                    session_token: C("create_channel_ajax")
                },
                B: v(function (a, d) {
                    var k = "yt.www.account.CreateChannelLightboxForm.init";
                    2 == d.type && (k = "yt.www.account.CreateGplusDialog.init");
                    t(k)(this.j,
                        b, c)
                }, a)
            };
            R("/create_channel_ajax", d)
        } else a.e = b
    };
    var yl, zl, Al, Bl, Cl = [],
        Dl = p,
        El = p,
        Fl = [];

    function Gl() {
        var a = L("body-container");
        Cl.push(W(a, "mousedown", Hl, "link-gplus-lightbox"));
        Cl.push(W(a, "click", Il, "link-gplus-lightbox"));
        Fl.push(E("LINK-GPLUS-LOADER-DISMISS", Jl));
        Fl.push(E("LINK-GPLUS-LOADER-GOTO-CONTENT-STATE", Kl));
        Fl.push(E("LINK-GPLUS-LOADER-GOTO-WORKING-STATE", Ll));
        Fl.push(E("LINK-GPLUS-LOADER-SET-WAIT-CURSOR", Ml));
        Fl.push(E("LINK-GPLUS-LOADER-SHOW-DIALOG", Nl))
    }
    function Ol() {
        Wb(Fl);
        V(Cl);
        Cl = [];
        yl = p
    }
    function Jl() {
        El = m;
        yi(zl, "cancel")
    }

    function Kl() {
        qi(zl, "content")
    }
    function Ll() {
        qi(zl, "working")
    }
    function Ml(a) {
        a ? document.body.style.cursor = "wait" : "wait" == document.body.style.cursor && (document.body.style.cursor = "default")
    }
    function Hl() {
        if (!L("link-gplus-css")) {
            xb(B("LINK_GPLUS_JS_URL"), Pl);
            var a = B("LINK_GPLUS_CSS_URL"),
                b = Rc("head", h, h)[0],
                a = Xc("link", {
                    id: "link-gplus-css",
                    rel: "stylesheet",
                    href: a
                });
            ed(b, a)
        }
    }
    function Pl() {
        Dl = m;
        yl && Dl && Ql()
    }

    function Il(a) {
        if (!zl) {
            var b = L("link-gplus-lb");
            if (!b) return;
            zl = new pi(b, m)
        }
        a ? (b = Q(a.target, "link-gplus-lightbox"), Al = K(b, "ignore-opt-out"), Bl = T(b, "upsell"), a.preventDefault()) : (Al = p, Bl = "signin", (a = B("ID_MERGE_FEATURE_TYPE")) && (Bl = a));
        El ? "upload" == Bl && aj("/my_videos_upload") : (yl = m, Ml(m), Dl && Ql())
    }

    function Ql() {
        var a = "";
        if ("upload" == Bl) a = "/my_videos_upload";
        else if ("settings" == Bl) a = "/account";
        else if ("active_signin" == Bl || "plus_page" == Bl) a = B("LINK_GPLUS_NEXT_URL");
        t("yt.www.account.LinkGplusDialog.fetchAndShow")(Bl, a, Al)
    }
    function Rl() {
        Gl();
        Hl();
        Il(n)
    }
    function Nl() {
        qi(zl, "content");
        zl.show();
        var a = N("yt-dialog-fg", L("link-gplus-lb")),
            b = Ng(a);
        a.style.position = "fixed";
        a.style.top = "95px";
        b.x && (a.style.left = b.x + "px")
    };
    var Sl, Tl, Ul;

    function Vl() {
        var a = Ei();
        Y(N("flag-comment-step1", a));
        X(N("flag-comment-step2", a));
        Y(N("flag-comment-step3", a))
    }

    function Wl() {
        var a = Ei(),
            b = N("flag-comment-form", a),
            c = N("flag-comment-block-user-input", a),
            d = N("submit-flag-comment", a),
            e = N("flag-comment-error-msg", a);
        Y(e);
        c.disabled = m;
        d.disabled = m;
        R("/comment_servlet", {
            format: "XML",
            method: "POST",
            G: {
                flag_comment: 1
            },
            F: Fe(Kd(b)),
            B: function (b, c) {
                c && c.html_content ? (Y(N("flag-comment-step1", a)), Y(N("flag-comment-step2", a)), X(N("flag-comment-step3", a)), N("flag-comment-captcha-placeholder", a).innerHTML = c.html_content) : zi.getInstance().hide()
            },
            onError: function (a, b) {
                var l =
                    b && b.error_message;
                if (l) {
                    var q = N("yt-alert-message", e);
                    pd(q, l)
                }
                X(e);
                c.disabled = p;
                d.disabled = p
            }
        })
    }
    function Xl(a) {
        var b = Ei(),
            c = N("abuse-type-placeholder", b);
        a = wd(a.currentTarget, "LABEL");
        pd(c, ud(a));
        N("continue-flag-comment", b).disabled = p
    };

    function Yl(a) {
        Yl[" "](a);
        return a
    }
    Yl[" "] = ca;
    var Zl = !G || zc(9),
        $l = G && !yc("9");
    !lc || yc("528");
    kc && yc("1.9b") || G && yc("8") || jc && yc("9.5") || lc && yc("528");
    kc && !yc("8") || G && yc("9");

    function am(a, b) {
        this.type = a;
        this.currentTarget = this.target = b
    }
    r = am.prototype;
    r.ma = function () {};
    r.lb = p;
    r.Nc = m;
    r.stopPropagation = function () {
        this.lb = m
    };
    r.preventDefault = function () {
        this.Nc = p
    };

    function bm(a, b) {
        a && this.init(a, b)
    }
    y(bm, am);
    r = bm.prototype;
    r.target = n;
    r.relatedTarget = n;
    r.clientX = 0;
    r.clientY = 0;
    r.button = 0;
    r.keyCode = 0;
    r.charCode = 0;
    r.ctrlKey = p;
    r.altKey = p;
    r.shiftKey = p;
    r.Qa = n;
    r.init = function (a, b) {
        var c = this.type = a.type;
        am.call(this, c);
        this.target = a.target || a.srcElement;
        this.currentTarget = b;
        var d = a.relatedTarget;
        if (d) {
            if (kc) {
                var e;
                a: {
                    try {
                        Yl(d.nodeName);
                        e = m;
                        break a
                    } catch (f) {}
                    e = p
                }
                e || (d = n)
            }
        } else "mouseover" == c ? d = a.fromElement : "mouseout" == c && (d = a.toElement);
        this.relatedTarget = d;
        this.clientX = a.clientX !== h ? a.clientX : a.pageX;
        this.clientY = a.clientY !== h ? a.clientY : a.pageY;
        this.button = a.button;
        this.keyCode = a.keyCode || 0;
        this.charCode = a.charCode || ("keypress" == c ? a.keyCode : 0);
        this.ctrlKey =
            a.ctrlKey;
        this.altKey = a.altKey;
        this.shiftKey = a.shiftKey;
        this.Qa = a;
        a.defaultPrevented && this.preventDefault();
        delete this.lb
    };
    r.stopPropagation = function () {
        bm.L.stopPropagation.call(this);
        this.Qa.stopPropagation ? this.Qa.stopPropagation() : this.Qa.cancelBubble = m
    };
    r.preventDefault = function () {
        bm.L.preventDefault.call(this);
        var a = this.Qa;
        if (a.preventDefault) a.preventDefault();
        else if (a.returnValue = p, $l) try {
                if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode) a.keyCode = -1
        } catch (b) {}
    };
    r.Dh = function () {
        return this.Qa
    };
    var cm = 0;

    function dm() {}
    r = dm.prototype;
    r.key = 0;
    r.removed = p;
    r.Fc = p;
    r.init = function (a, b, c, d, e, f) {
        ja(a) ? this.b = m : a && a.handleEvent && ja(a.handleEvent) ? this.b = p : g(Error("Invalid listener argument"));
        this.Fa = a;
        this.proxy = b;
        this.src = c;
        this.type = d;
        this.capture = !! e;
        this.yc = f;
        this.Fc = p;
        this.key = ++cm;
        this.removed = p
    };
    r.handleEvent = function (a) {
        return this.b ? this.Fa.call(this.yc || this.src, a) : this.Fa.handleEvent.call(this.Fa, a)
    };
    var em = {}, fm = {}, gm = {}, hm = {};

    function im(a, b, c, d, e) {
        if (ga(b)) {
            for (var f = 0; f < b.length; f++) im(a, b[f], c, d, e);
            return n
        }
        a: {
            b || g(Error("Invalid event type"));
            d = !! d;
            var k = fm;
            b in k || (k[b] = {
                J: 0,
                fa: 0
            });
            k = k[b];
            d in k || (k[d] = {
                J: 0,
                fa: 0
            }, k.J++);
            var k = k[d],
                f = la(a),
                l;
            k.fa++;
            if (k[f]) {
                l = k[f];
                for (var q = 0; q < l.length; q++) if (k = l[q], k.Fa == c && k.yc == e) {
                        if (k.removed) break;
                        l[q].Fc = p;
                        a = l[q];
                        break a
                    }
            } else l = k[f] = [], k.J++;
            q = jm();
            k = new dm;
            k.init(c, q, a, b, d, e);
            k.Fc = p;
            q.src = a;
            q.Fa = k;
            l.push(k);
            gm[f] || (gm[f] = []);
            gm[f].push(k);
            a.addEventListener ? (a == s || !a.customEvent_) &&
                a.addEventListener(b, q, d) : a.attachEvent(b in hm ? hm[b] : hm[b] = "on" + b, q);
            a = k
        }
        b = a.key;
        em[b] = a;
        return b
    }
    function jm() {
        var a = km,
            b = Zl ? function (c) {
                return a.call(b.src, b.Fa, c)
            } : function (c) {
                c = a.call(b.src, b.Fa, c);
                if (!c) return c
            };
        return b
    }
    function lm(a, b, c, d, e) {
        if (ga(b)) for (var f = 0; f < b.length; f++) lm(a, b[f], c, d, e);
        else if (d = !! d, a = mm(a, b, d)) for (f = 0; f < a.length; f++) if (a[f].Fa == c && a[f].capture == d && a[f].yc == e) {
                    nm(a[f].key);
                    break
                }
    }

    function nm(a) {
        var b = em[a];
        if (!b || b.removed) return p;
        var c = b.src,
            d = b.type,
            e = b.proxy,
            f = b.capture;
        c.removeEventListener ? (c == s || !c.customEvent_) && c.removeEventListener(d, e, f) : c.detachEvent && c.detachEvent(d in hm ? hm[d] : hm[d] = "on" + d, e);
        c = la(c);
        gm[c] && (e = gm[c], Va(e, b), 0 == e.length && delete gm[c]);
        b.removed = m;
        if (b = fm[d][f][c]) b.Le = m, om(d, f, c, b);
        delete em[a];
        return m
    }

    function om(a, b, c, d) {
        if (!d.Oc && d.Le) {
            for (var e = 0, f = 0; e < d.length; e++) d[e].removed ? d[e].proxy.src = n : (e != f && (d[f] = d[e]), f++);
            d.length = f;
            d.Le = p;
            0 == f && (delete fm[a][b][c], fm[a][b].J--, 0 == fm[a][b].J && (delete fm[a][b], fm[a].J--), 0 == fm[a].J && delete fm[a])
        }
    }
    function pm(a) {
        var b = 0;
        if (a != n) {
            if (a = la(a), gm[a]) {
                a = gm[a];
                for (var c = a.length - 1; 0 <= c; c--) nm(a[c].key), b++
            }
        } else fb(em, function (a, c) {
                nm(c);
                b++
            })
    }
    function mm(a, b, c) {
        var d = fm;
        return b in d && (d = d[b], c in d && (d = d[c], a = la(a), d[a])) ? d[a] : n
    }

    function qm(a, b, c, d, e) {
        var f = 1;
        b = la(b);
        if (a[b]) {
            var k = --a.fa,
                l = a[b];
            l.Oc ? l.Oc++ : l.Oc = 1;
            try {
                for (var q = l.length, A = 0; A < q; A++) {
                    var H = l[A];
                    H && !H.removed && (f &= rm(H, e) !== p)
                }
            } finally {
                a.fa = Math.max(k, a.fa), l.Oc--, om(c, d, b, l)
            }
        }
        return Boolean(f)
    }
    function rm(a, b) {
        a.Fc && nm(a.key);
        return a.handleEvent(b)
    }

    function km(a, b) {
        if (a.removed) return m;
        var c = a.type,
            d = fm;
        if (!(c in d)) return m;
        var d = d[c],
            e, f;
        if (!Zl) {
            e = b || t("window.event");
            var k = m in d,
                l = p in d;
            if (k) {
                if (0 > e.keyCode || e.returnValue != h) return m;
                a: {
                    var q = p;
                    if (0 == e.keyCode) try {
                            e.keyCode = -1;
                            break a
                    } catch (A) {
                        q = m
                    }
                    if (q || e.returnValue == h) e.returnValue = m
                }
            }
            q = new bm;
            q.init(e, this);
            e = m;
            try {
                if (k) {
                    for (var H = [], O = q.currentTarget; O; O = O.parentNode) H.push(O);
                    f = d[m];
                    f.fa = f.J;
                    for (var P = H.length - 1; !q.lb && 0 <= P && f.fa; P--) q.currentTarget = H[P], e &= qm(f, H[P], c, m, q);
                    if (l) {
                        f =
                            d[p];
                        f.fa = f.J;
                        for (P = 0; !q.lb && P < H.length && f.fa; P++) q.currentTarget = H[P], e &= qm(f, H[P], c, p, q)
                    }
                } else e = rm(a, q)
            } finally {
                H && (H.length = 0)
            }
            return e
        }
        c = new bm(b, this);
        return e = rm(a, c)
    };

    function sm(a) {
        var b;
        switch (a) {
            case "PENDING":
                b = Sb("COMMENT_PENDING");
                break;
            case "BLOCKED":
                b = Sb("COMMENT_BLOCKED");
                break;
            case "EMAIL":
                b = Sb("COMMENT_ERROR_EMAIL");
                break;
            case "INLINE_CAPTCHAFAIL":
                b = Sb("COMMENT_CAPTCHAFAIL");
                break;
            case "SHOW_COUNTDOWN":
                b = Sb("SHOW_COUNTDOWN");
                break;
            case "FAILED_MAINTENANCE":
                b = Sb("COMMENT_FAILED_MAINTENANCE");
                break;
            case "FAILED_OWNER_LINKING":
                b = Sb("COMMENT_OWNER_LINKING");
                break;
            case "FAILED_HASLINK":
                b = Sb("FAILED_HASLINK");
                break;
            case "FAILED_HASTAGS":
                b = Sb("FAILED_HASTAGS");
                break;
            case "FAILED_ASCIIART":
                b = Sb("FAILED_ASCIIART");
                break;
            case "FAILED_TOOSHORT":
                b = Sb("FAILED_TOOSHORT");
                break;
            case "FAILED_TOOLONG":
                b = Sb("FAILED_TOOLONG");
                break;
            case "FAILED_BADPARENT":
                b = Sb("FAILED_BADPARENT")
        }
        return b || n
    }

    function tm(a, b, c) {
        this.A = !! c;
        this.O = a;
        this.ef = L("all-comments");
        this.Ha = og("button", n, a);
        this.ha = og("textarea", n, a);
        this.Va = n;
        this.b = N("comments-remaining", this.O);
        this.j = parseInt(T(this.b, "max-count"), 10);
        this.Ua = N("comments-post-message", this.O);
        this.Cd = N("yt-alert-content", this.Ua);
        this.e = N("comments-threshold-countdown", this.O);
        this.o = [];
        this.g = [];
        this.i = n;
        um(this);
        vm(this, this.ha, "focus", this.Jd);
        vm(this, this.ha, "blur", this.vf);
        vm(this, this.O, "submit", this.Id);
        vm(this, this.ha, "change", this.Kd);
        vm(this, this.ha, "keyup", this.Kd);
        vm(this, this.ha, "keydown", this.wf);
        b && this.Jd()
    }
    function wm(a) {
        V(a.o);
        a.o = [];
        z(a.g, function (a) {
            window.clearInterval(a)
        });
        a.g = [];
        fg(a.O, "initialized")
    }
    function xm(a) {
        ym(a);
        zm(a);
        J(a.O, "has-focus");
        a.Ha.disabled = p;
        a.ha.value = "";
        um(a);
        a.ha.blur();
        a.i = n;
        wm(a);
        F("comment-form-reset")
    }
    r = tm.prototype;
    r.focus = function () {
        this.ha.focus()
    };

    function vm(a, b, c, d) {
        a.o.push(U(b, c, v(d, a)))
    }
    function ym(a) {
        a.Va && (a.Va.innerHTML = "")
    }

    function um(a) {
        var b = a.j - a.ha.value.length;
        a.b.innerHTML = Tb("CHARACTERS_REMAINING" in Jb ? Jb.CHARACTERS_REMAINING : {}, b);
        b = 0 > b;
        Mc(a.b, "too-many", b);
        a.Ha.disabled = b
    }
    function Am(a, b) {
        var c = v(function () {
            0 == b ? (window.clearInterval(d), zm(this)) : (b--, this.e.innerHTML = Tb("SECONDS_REMAINING" in Jb ? Jb.SECONDS_REMAINING : {}, b))
        }, a);
        Bm(a);
        var d = Pb(c, 1E3);
        c();
        a.g.push(d)
    }
    function Bm(a) {
        Y(a.b);
        X(a.e);
        a.Ha.disabled = m
    }
    function zm(a) {
        Y(a.e);
        Y(a.Ua);
        X(a.b);
        a.e.innerHTML = "";
        a.Ha.disabled = p
    }
    r.Kd = function () {
        this.ha.readOnly || um(this)
    };
    r.wf = function (a) {
        if (this.A) switch (a.keyCode) {
                case 13:
                    this.Id(a);
                    break;
                case 27:
                    xm(this)
        }
    };
    r.Jd = function () {
        K(this.O, "has-focus") || Y(this.Ua);
        I(this.O, "has-focus");
        F("comments-focus", this.O)
    };
    r.vf = function () {
        F("comments-blur", this.O)
    };
    r.Id = function (a) {
        a.preventDefault();
        if (!this.Ha.disabled) {
            this.Ha.disabled = m;
            this.ha.readOnly = m;
            a = Fe(Kd(this.O));
            a.screen = He({
                h: window.screen.height,
                w: window.screen.width,
                d: window.screen.colorDepth
            });
            var b = a.comment,
                b = {
                    return_ajax: "true",
                    len: b.length,
                    wc: b.split(/\s+/).length
                };
            this.O.reply_parent_id.value && (b.reply = 1);
            this.i && (b.tag = this.i);
            var c = B("PLAYBACK_ID");
            c && (a.plid = c);
            R(this.O.action, {
                format: "XML",
                method: "POST",
                G: b,
                F: a,
                da: function (a, b) {
                    var c = b.str_code;
                    switch (c) {
                        case "OK":
                            c = document.createElement("ul");
                            c.innerHTML = b.html_content;
                            c = kd(c);
                            if (this.O.reply_parent_id.value) {
                                var k = wd(this.O, n, "comments-post-container"),
                                    l = wd(k, n, "comment");
                                fd(k);
                                Lc(l, "replying", "has-child");
                                I(c, "child");
                                Mc(c, "last", !(l.nextElementSibling != h ? l.nextElementSibling : ld(l.nextSibling, m)));
                                l.parentNode && l.parentNode.insertBefore(c, l.nextSibling)
                            } else ed(this.ef, c), xm(this);
                            Oj(c);
                            F("comment-submit-success");
                            "True" == b.show_feed_privacy_dialog && F("SHOW-COMMENT-DIALOG", B("VIDEO_ID"), b.time_created);
                            break;
                        case "PENDING":
                            ym(this);
                            this.Cd.innerHTML = Sb("COMMENT_PENDING");
                            Lc(this.Ua, "yt-alert-error", "yt-alert-info");
                            X(this.Ua);
                            break;
                        default:
                            Cm(this, c, b)
                    }
                    this.ha.readOnly = p
                },
                R: this
            });
            wf("comment")
        }
    };

    function Cm(a, b, c) {
        var d = sm(b) || Sb("COMMENT_ERROR");
        a.Cd.innerHTML = d;
        Lc(a.Ua, "yt-alert-info", "yt-alert-error");
        X(a.Ua);
        switch (b) {
            case "INLINE_CAPTCHA":
            case "INLINE_CAPTCHAFAIL":
                R("/comment_servlet?gimme_captcha=1", {
                    format: "XML",
                    method: "POST",
                    F: {
                        session_token: C("comment_servlet")
                    },
                    B: function (a, b) {
                        if (!this.Va) {
                            this.Va = document.createElement("div");
                            this.Va.className = "comment-captcha";
                            var c = this.ha;
                            c.parentNode && c.parentNode.insertBefore(this.Va, c.nextSibling)
                        }
                        this.Va.innerHTML = b.html_content;
                        this.Ha.disabled =
                            p
                    },
                    R: a
                });
                break;
            case "SHOW_COUNTDOWN":
                Am(a, parseInt(c.countdown_timer, 10) || 30);
                break;
            default:
                a.Ha.disabled = p, ym(a)
        }
    };

    function Dm(a) {
        this.D = a;
        this.Qd = N("yt-uix-pager-show-more");
        this.g = !! B("ENABLE_LIVE_COMMENTS");
        this.b = [];
        (a = N("comments-pagination", this.D)) && T(a, "ajax-enabled") && this.b.push(W(this.D, "click", v(this.i, this), "yt-uix-pager-button"))
    }
    Dm.prototype.i = function (a) {
        a.preventDefault();
        K(a.currentTarget, "yt-uix-button-toggled") || (Y(this.Qd), F("comments-page-changing"), this.Yb ? this.e(2) : Em(this, v(this.e, this, 2)))
    };
    Dm.prototype.e = function (a) {
        var b = L("comments-view");
        b.appendChild(this.Yb);
        Oj(b);
        if (b = L("comments-textarea")) b.disabled = p, b.id = "";
        if (b = N("comment-list", this.D)) {
            var c = N("live-comments-setting", this.D);
            F("comments-page-changed", b, c, a)
        }
        Em(this)
    };

    function Em(a, b) {
        var c = Rc("li", "comment", h),
            c = T(c[c.length - 1], "id"),
            d = a.Yb ? p : m;
        X("comments-loading");
        Fm(a, c, function (a, c) {
            c.html_content && (Y("comments-loading"), this.Yb = document.createElement("div"), this.Yb.innerHTML = c.html_content, !d && 0 < Rc("li", "comment", this.Yb).length && X(this.Qd), b && b())
        })
    }

    function Fm(a, b, c) {
        R("/watch_ajax?action_get_comments=1", {
            format: "XML",
            G: {
                v: B("VIDEO_ID"),
                p: 1,
                commentthreshold: B("COMMENTS_THRESHHOLD"),
                commenttype: "everything",
                enable_live_comments: a.g ? "yes" : n,
                last_comment_id: b,
                page_size: B("COMMENTS_PAGE_SIZE"),
                source: B("COMMENT_SOURCE")
            },
            B: c,
            R: a
        })
    };

    function Gm(a, b, c) {
        a = wd(a, "form");
        gg(a, "initialized") || (S(a, "initialized", "true"), Sl = new tm(a, !b, c), b && Sl.focus())
    }
    function Hm() {
        B("WATCH7_DELAYED_COMMENTS") ? Im() : Jm()
    }
    function Im() {
        Tl = R("/comments_ajax", {
            method: "POST",
            G: {
                v: B("VIDEO_ID")
            },
            F: {
                session_token: C("comments_ajax")
            },
            B: function (a, b) {
                b && (t("spf.process")(b), Jm(), Oj(L("comments-view")))
            }
        }) || n
    }

    function Jm() {
        var a = L("comments-view");
        Ul = new Dm(L("watch-discussion"));
        Km.push(W(a, "click", Lm, "comment-action"));
        if (a = L("comments-textarea")) a.disabled = p, a.id = "";
        B("COMMENT_OPEN_REPLY_BOX") && (a = M("comment", L("linked-comments-header")), Mm(a[a.length - 1]))
    }
    function Nm() {
        Tl && (Tl.abort(), Tl = n);
        Sl && (wm(Sl), Sl = n);
        var a = Ul;
        V(a.b);
        a.b = [];
        Ul = n;
        V(Km);
        Km = []
    }

    function Lm(a) {
        a = a.currentTarget;
        var b = wd(a, n, "comment");
        switch (T(a, "action")) {
            case "approve":
                Om(b);
                break;
            case "block":
                confirm(Sb("BLOCK_USER")) && (Pm(b, m), I(b, "blocked"));
                break;
            case "unblock":
                Pm(b, p);
                J(b, "blocked");
                break;
            case "flag-in-place":
                if (Qm(p)) {
                    var c = L("comment-flag-area");
                    a = T(b, "id");
                    var d = T(b, "author-id"),
                        e = ud(N("author", b)),
                        b = N("comment-text", b).innerHTML,
                        f = B("VIDEO_ID");
                    zi.getInstance().show(c);
                    c = Ei();
                    N("flagged-comment-id", c).value = a;
                    N("flagged-comment-author-id", c).value = d;
                    N("flagged-comment-video-id",
                        c).value = f;
                    pd(N("flagged-comment-author-name", c), e);
                    N("flagged-comment-text", c).appendChild(ad(b));
                    U(N("continue-flag-comment", c), "click", Vl);
                    W(c, "click", Wl, "submit-flag-comment");
                    W(c, "click", Xl, "abuse-type-radio-input")
                }
                break;
            case "flag":
                Rm(b, "mark_comment_as_spam");
                break;
            case "flag-profile-pic":
                Rm(b, "flag_profile_pic");
                break;
            case "unflag":
                a = T(b, "id");
                R("/comment_servlet", {
                    format: "XML",
                    method: "POST",
                    F: {
                        unmark_comment_as_spam: a,
                        entity_id: B("VIDEO_ID"),
                        session_token: C("comment_servlet")
                    }
                });
                break;
            case "hide":
                I(b,
                    "hidden");
                break;
            case "show":
                J(b, "hidden");
                break;
            case "remove":
                Sm(b);
                break;
            case "reply":
                Mm(b);
                break;
            case "realtime-reply":
                Qm(m) && (Sl || (a = N("comments-textarea", L("comments-view")), Gm(a)), a = Sl, xm(a), a.focus());
                break;
            case "vote-up":
                Tm(b, m);
                break;
            case "vote-down":
                Tm(b, p);
                break;
            case "show-parent":
                Um(b)
        }
    }

    function Qm(a) {
        return B("COMMENTS_SIGNIN_URL") ? (aj(B("COMMENTS_SIGNIN_URL")), p) : a && B("COMMENTS_CHANNEL_CREATE_URL") ? (aj(B("COMMENTS_CHANNEL_CREATE_URL")), p) : !B("COMMENTS_YPC_CAN_POST_OR_REACT_TO_COMMENT") ? p : m
    }
    function Om(a) {
        var b = T(a, "id"),
            c = B("VIDEO_ID");
        J(a, "pending");
        R("/comment_servlet?field_approve_comment=1", {
            format: "XML",
            method: "POST",
            F: {
                comment_id: b,
                entity_id: c,
                session_token: C("comment_servlet")
            },
            onError: function () {
                I(a, "pending")
            }
        })
    }

    function Pm(a, b) {
        var c = {};
        c["action_" + (b ? "" : "un") + "block_commenter"] = 1;
        var d = T(a, "id");
        R("/link_ajax", {
            format: "XML",
            method: "POST",
            G: c,
            F: {
                session_token: C("link_ajax"),
                comment_id: d
            },
            B: function (a, b) {
                b && b.success_message && window.alert(b.success_message)
            }
        })
    }
    function Rm(a, b) {
        if (Qm(p)) {
            var c = T(a, "id"),
                d = B("VIDEO_ID");
            Y(a);
            I(a, "flagged");
            d = {
                entity_id: d
            };
            d[b] = c;
            R("/comment_servlet", {
                format: "XML",
                method: "POST",
                G: d,
                F: {
                    session_token: C("comment_servlet")
                },
                onError: function () {
                    X(a);
                    J(a, "flagged")
                }
            })
        }
    }

    function Sm(a) {
        var b = T(a, "id"),
            c = B("VIDEO_ID");
        Y(a);
        R("/comment_servlet?remove_comment=1", {
            format: "XML",
            method: "POST",
            F: {
                comment_id: b,
                entity_id: c,
                session_token: C("comment_servlet")
            },
            onError: function () {
                X(a)
            }
        })
    }

    function Mm(a) {
        if (Qm(m)) if (K(a, "replying")) K(a, "replying") && (J(a, "replying"), a = N("comments-post-container", a), fd(a));
            else {
                I(a, "replying");
                var b = N("comments-post", L("watch-discussion") || L("watch-discussion")),
                    b = mg(b),
                    c = document.createElement("div");
                c.className = "comments-post-container";
                a.appendChild(c);
                c.appendChild(b);
                b = new tm(b);
                xm(b);
                c = T(a, "id");
                b.O.reply_parent_id.value = c;
                if (a = T(a, "tag")) b.i = a;
                b.focus()
            }
    }

    function Tm(a, b) {
        if (Qm(p) && !T(a, "voted")) {
            var c = T(a, "id"),
                d = B("VIDEO_ID"),
                e = T(a, "score") || "0",
                f = b ? 1 : -1;
            S(a, "voted", f + "");
            b ? Lc(a, "voted-down", "voted-up") : Lc(a, "voted-up", "voted-down");
            c = {
                a: f,
                id: c,
                video_id: d,
                old_vote: e
            };
            (d = T(a, "tag")) && (c.tag = d);
            R("/comment_voting", {
                format: "XML",
                method: "POST",
                G: c,
                F: {
                    session_token: C("comment_voting")
                }
            })
        }
    }

    function Um(a) {
        var b = T(a, "id"),
            c = B("VIDEO_ID");
        J(a, "has-child");
        I(a, "child");
        var d = L("parent-comment-loading");
        if (d) {
            var e = mg(d);
            dd(e, a);
            X(e)
        }
        R("/comment_servlet?get_comment_parent=1", {
            format: "XML",
            method: "POST",
            F: {
                comment_id: b,
                entity_id: c,
                session_token: C("comment_servlet")
            },
            B: function (b, c) {
                var d = document.createElement("ul");
                d.innerHTML = c.html_content;
                d = kd(d);
                dd(d, a);
                fd(e);
                Lj(d)
            },
            onError: function (b, c) {
                I(a, "has-child");
                J(a, "child");
                fd(e);
                c && c.error_message ? window.alert(c.error_message) : window.alert("Request failed, please try later.")
            }
        })
    }
    var Km = [];
    var Vm, Wm, Xm, Ym, Zm, $m, an, bn, cn = [];

    function dn() {
        var a = Ei(),
            b = N("subscription-picker", a),
            a = T(b, "collection-id"),
            c = M("subscription-list-item", b),
            d = Na(Ma(c, function (a) {
                return K(a, "selected") && !K(a, "saved")
            }), function (a) {
                return T(a, "channel-id")
            }),
            c = Na(Ma(c, function (a) {
                return !K(a, "selected") && K(a, "saved")
            }), function (a) {
                return T(a, "channel-id")
            }),
            e = N("collection-name-input", b).value;
        en(b);
        fn(b, m);
        e = {
            name: e,
            session_token: C("subscription_ajax")
        };
        if (a) {
            var f = "/subscription_ajax?action_update_collection=1";
            e.collection_id = a;
            e.added_ids = d.join(",");
            e.removed_ids = c.join(",")
        } else f = "/subscription_ajax?action_add_collection=1", e.external_channel_ids = d.join(",");
        R(f, {
            method: "POST",
            F: e,
            B: function (a, c) {
                en(b);
                zi.getInstance().hide();
                c.response && c.response.collection_url && aj(c.response.collection_url)
            },
            onError: gn(b)
        })
    }

    function hn() {
        var a = Ei(),
            b = N("subscription-picker", a),
            a = T(b, "collection-id");
        en(b);
        fn(b, m);
        R("/subscription_ajax?action_remove_collection=1", {
            method: "POST",
            F: {
                collection_id: a,
                session_token: C("subscription_ajax")
            },
            B: function () {
                en(b);
                zi.getInstance().hide();
                aj("/")
            },
            onError: gn(b)
        })
    }
    function jn(a) {
        Nc(a.currentTarget, "selected")
    }
    function en(a) {
        kn(a, "");
        ln(a, p);
        fn(a, p)
    }
    function ln(a, b) {
        var c = N("subscription-picker-loading", a);
        Jg(c, b)
    }
    function fn(a, b) {
        var c = N("subscription-picker-saving", a);
        Jg(c, b)
    }

    function kn(a, b) {
        var c = N("subscription-picker-errors", a);
        Jg(c, "" != b);
        b && (c.innerHTML = b)
    }
    function gn(a) {
        return function (b, c) {
            en(a);
            var d = c.errors;
            d && 0 < d.length && kn(a, d[0])
        }
    };
    var mn = [],
        nn = "";

    function on() {
        ch("addto-watch-later-button", "click", pn);
        ch("addto-watch-later-button-success", "click", qn);
        ch("addto-watch-later-button-sign-in", "click", rn);
        mn.push(W(L("shared-addto-watch-later-login"), "click", sn, "sign-in-link"))
    }
    function tn() {
        dh("addto-watch-later-button", pn);
        dh("addto-watch-later-button-success", qn);
        dh("addto-watch-later-button-sign-in", rn);
        V(mn);
        mn = []
    }
    function rn(a) {
        nn = T(a, "video-ids")
    }

    function sn(a) {
        var b = Ke("/addto_ajax", {
            action_redirect_to_signin_with_add: 1,
            list_type: "WL",
            video_ids: nn,
            next_url: document.location
        }),
            c = document.createElement("form");
        c.action = b;
        c.method = "POST";
        b = document.createElement("input");
        b.type = "hidden";
        b.name = "session_token";
        b.value = C("addto_ajax_logged_out");
        c.appendChild(b);
        document.body.appendChild(c);
        c.submit();
        a.preventDefault()
    }

    function pn(a) {
        Kc(a, "addto-watch-later-button", "addto-watch-later-button-loading");
        var b = T(a, "video-ids");
        R("/addto_ajax", {
            method: "POST",
            format: "XML",
            G: {
                action_add_to_watch_later_list: 1
            },
            F: {
                session_token: C("addto_ajax"),
                video_ids: b
            },
            B: function (c, d) {
                un(d.list_id, b, a)
            },
            onError: function (c, d) {
                6 == d.return_code ? un(d.list_id, b, a) : vn(a, d)
            }
        })
    }

    function qn(a) {
        Kc(a, "addto-watch-later-button-success", "addto-watch-later-button-loading");
        var b = T(a, "video-ids");
        R("/addto_ajax", {
            method: "POST",
            format: "XML",
            G: {
                action_delete_from_watch_later_list: 1
            },
            F: {
                session_token: C("addto_ajax"),
                video_ids: b
            },
            B: function () {
                Kc(a, "addto-watch-later-button-loading", "addto-watch-later-button")
            },
            onError: function (b, d) {
                vn(a, d)
            }
        })
    }

    function un(a, b, c) {
        Kc(c, "addto-watch-later-button-loading", "addto-watch-later-button-success");
        var d = Sb("ADDTO_WATCH_LATER_ADDED");
        hj(dj.getInstance(), c, d);
        F("WATCH_LATER_UPDATED", a, b.split(","))
    }
    function vn(a, b) {
        Kc(a, "addto-watch-later-button-loading", "addto-watch-later-button-error");
        var c = b.error_message || Sb("ADDTO_WATCH_LATER_ERROR");
        hj(dj.getInstance(), a, c)
    };
    var wn = "undefined" != typeof DOMTokenList,
        xn = wn ? function (a) {
            return a.classList
        } : function (a) {
            a = a.className;
            return u(a) && a.match(/\S+/g) || []
        }, yn = wn ? function (a, b) {
            return a.classList.contains(b)
        } : function (a, b) {
            return Sa(xn(a), b)
        }, zn = wn ? function (a, b) {
            a.classList.add(b)
        } : function (a, b) {
            yn(a, b) || (a.className += 0 < a.className.length ? " " + b : b)
        }, An = wn ? function (a, b) {
            a.classList.remove(b)
        } : function (a, b) {
            yn(a, b) && (a.className = Ma(xn(a), function (a) {
                return a != b
            }).join(" "))
        };

    function Bn(a) {
        this.e = a;
        this.b = []
    }
    y(Bn, Cb);
    var Cn = [];

    function Dn(a, b, c, d) {
        ga(c) || (Cn[0] = c, c = Cn);
        for (var e = 0; e < c.length; e++) {
            var f = im(b, c[e], d || a, p, a.e || a);
            a.b.push(f)
        }
    }
    function En(a, b, c, d, e, f) {
        if (ga(c)) for (var k = 0; k < c.length; k++) En(a, b, c[k], d, e, f);
        else {
            a: {
                d = d || a;
                f = f || a.e || a;
                e = !! e;
                if (b = mm(b, c, e)) for (c = 0; c < b.length; c++) if (!b[c].removed && b[c].Fa == d && b[c].capture == e && b[c].yc == f) {
                            b = b[c];
                            break a
                        }
                b = n
            }
            b && (b = b.key, nm(b), Va(a.b, b))
        }
    }
    Bn.prototype.removeAll = function () {
        z(this.b, nm);
        this.b.length = 0
    };
    Bn.prototype.P = function () {
        Bn.L.P.call(this);
        this.removeAll()
    };
    Bn.prototype.handleEvent = function () {
        g(Error("EventHandler.handleEvent not implemented"))
    };

    function Fn() {}
    y(Fn, Cb);
    Fn.prototype.customEvent_ = m;
    r = Fn.prototype;
    r.Kc = n;
    r.ud = function (a) {
        this.Kc = a
    };
    r.addEventListener = function (a, b, c, d) {
        im(this, a, b, c, d)
    };
    r.removeEventListener = function (a, b, c, d) {
        lm(this, a, b, c, d)
    };

    function Gn(a, b) {
        var c = b,
            d = c.type || c,
            e = fm;
        if (d in e) {
            if (u(c)) c = new am(c, a);
            else if (c instanceof am) c.target = c.target || a;
            else {
                var f = c,
                    c = new am(d, a);
                pb(c, f)
            }
            var f = 1,
                k, e = e[d],
                d = m in e,
                l;
            if (d) {
                k = [];
                for (l = a; l; l = l.Kc) k.push(l);
                l = e[m];
                l.fa = l.J;
                for (var q = k.length - 1; !c.lb && 0 <= q && l.fa; q--) c.currentTarget = k[q], f &= qm(l, k[q], c.type, m, c) && c.Nc != p
            }
            if (p in e) if (l = e[p], l.fa = l.J, d) for (q = 0; !c.lb && q < k.length && l.fa; q++) c.currentTarget = k[q], f &= qm(l, k[q], c.type, p, c) && c.Nc != p;
                else for (e = a; !c.lb && e && l.fa; e = e.Kc) c.currentTarget =
                            e, f &= qm(l, e, c.type, p, c) && c.Nc != p
        }
    }
    r.P = function () {
        Fn.L.P.call(this);
        pm(this);
        this.Kc = n
    };

    function Hn(a, b) {
        this.b = a || 1;
        this.g = b || In;
        this.i = v(this.ag, this);
        this.j = w()
    }
    y(Hn, Fn);
    Hn.prototype.e = p;
    var In = s;
    r = Hn.prototype;
    r.Ea = n;

    function Jn(a, b) {
        a.b = b;
        a.Ea && a.e ? (a.stop(), a.start()) : a.Ea && a.stop()
    }
    r.ag = function () {
        if (this.e) {
            var a = w() - this.j;
            0 < a && a < 0.8 * this.b ? this.Ea = this.g.setTimeout(this.i, this.b - a) : (Gn(this, "tick"), this.e && (this.Ea = this.g.setTimeout(this.i, this.b), this.j = w()))
        }
    };
    r.start = function () {
        this.e = m;
        this.Ea || (this.Ea = this.g.setTimeout(this.i, this.b), this.j = w())
    };
    r.stop = function () {
        this.e = p;
        this.Ea && (this.g.clearTimeout(this.Ea), this.Ea = n)
    };
    r.P = function () {
        Hn.L.P.call(this);
        this.stop();
        delete this.g
    };

    function Kn(a, b, c) {
        ja(a) ? c && (a = v(a, c)) : a && "function" == typeof a.handleEvent ? a = v(a.handleEvent, a) : g(Error("Invalid listener argument"));
        return 2147483647 < b ? -1 : In.setTimeout(a, b || 0)
    };

    function Ln() {}
    da(Ln);
    Ln.prototype.b = 0;
    Ln.getInstance();

    function Mn(a) {
        this.i = a || Oc()
    }
    y(Mn, Fn);
    r = Mn.prototype;
    r.Og = Ln.getInstance();
    r.te = n;
    r.pb = p;
    r.jb = n;
    r.Ic = n;
    r.Jc = n;
    r.$b = n;
    r.Bd = p;
    r.getId = function () {
        return this.te || (this.te = ":" + (this.Og.b++).toString(36))
    };
    r.H = function () {
        return this.jb
    };
    r.ud = function (a) {
        this.Ic && this.Ic != a && g(Error("Method not supported"));
        Mn.L.ud.call(this, a)
    };
    r.Sc = function (a) {
        this.jb = a
    };
    r.cc = function () {
        this.pb = m;
        Nn(this, function (a) {
            !a.pb && a.H() && a.cc()
        })
    };
    r.Ub = function () {
        Nn(this, function (a) {
            a.pb && a.Ub()
        });
        this.j && this.j.removeAll();
        this.pb = p
    };
    r.P = function () {
        this.pb && this.Ub();
        this.j && (this.j.ma(), delete this.j);
        Nn(this, function (a) {
            a.ma()
        });
        !this.Bd && this.jb && fd(this.jb);
        this.Ic = this.jb = this.$b = this.Jc = n;
        Mn.L.P.call(this)
    };

    function Nn(a, b) {
        a.Jc && z(a.Jc, b, h)
    }
    r.removeChild = function (a, b) {
        if (a) {
            var c = u(a) ? a : a.getId();
            a = this.$b && c ? (c in this.$b ? this.$b[c] : h) || n : n;
            if (c && a) {
                var d = this.$b;
                c in d && delete d[c];
                Va(this.Jc, a);
                b && (a.Ub(), a.jb && fd(a.jb));
                c = a;
                c == n && g(Error("Unable to set parent component"));
                c.Ic = n;
                Mn.L.ud.call(c, n)
            }
        }
        a || g(Error("Child is not in parent component"));
        return a
    };

    function On(a, b) {
        this.i = b || Oc();
        this.e = a || ""
    }
    y(On, Mn);
    On.prototype.g = n;
    var Pn = "placeholder" in document.createElement("input");
    r = On.prototype;
    r.Pb = p;
    r.Sc = function (a) {
        On.L.Sc.call(this, a);
        this.e || (this.e = a.getAttribute("label") || "");
        var b;
        a: {
            var c = Qc(a);
            try {
                b = c && c.activeElement;
                break a
            } catch (d) {}
            b = n
        }
        b == a && (this.Pb = m, An(this.H(), "label-input-label"));
        Pn ? this.H().placeholder = this.e : this.H().setAttribute("aria-label", this.e)
    };
    r.cc = function () {
        On.L.cc.call(this);
        var a = new Bn(this);
        Dn(a, this.H(), "focus", this.ke);
        Dn(a, this.H(), "blur", this.Eg);
        Pn ? this.b = a : (kc && Dn(a, this.H(), ["keypress", "keydown", "keyup"], this.Fg), Dn(a, Qc(this.H()) ? Qc(this.H()).parentWindow || Qc(this.H()).defaultView : window, "load", this.Gg), this.b = a, Qn(this));
        Rn(this);
        this.H().b = this
    };
    r.Ub = function () {
        On.L.Ub.call(this);
        this.b && (this.b.ma(), this.b = n);
        this.H().b = n
    };

    function Qn(a) {
        !a.A && (a.b && a.H().form) && (Dn(a.b, a.H().form, "submit", a.Bg), a.A = m)
    }
    r.P = function () {
        On.L.P.call(this);
        this.b && (this.b.ma(), this.b = n)
    };
    r.ke = function () {
        this.Pb = m;
        An(this.H(), "label-input-label");
        if (!Pn && !Sn(this) && !this.C) {
            var a = this,
                b = function () {
                    a.H() && (a.H().value = "")
                };
            G ? Kn(b, 10) : b()
        }
    };
    r.Eg = function () {
        Pn || (En(this.b, this.H(), "click", this.ke), this.g = n);
        this.Pb = p;
        Rn(this)
    };
    r.Fg = function (a) {
        27 == a.keyCode && ("keydown" == a.type ? this.g = this.H().value : "keypress" == a.type ? this.H().value = this.g : "keyup" == a.type && (this.g = n), a.preventDefault())
    };
    r.Bg = function () {
        Sn(this) || (this.H().value = "", Kn(this.uh, 10, this))
    };
    r.uh = function () {
        Sn(this) || (this.H().value = this.e)
    };
    r.Gg = function () {
        Rn(this)
    };

    function Sn(a) {
        return !!a.H() && "" != a.H().value && a.H().value != a.e
    }
    r.clear = function () {
        this.H().value = "";
        this.g != n && (this.g = "")
    };

    function Rn(a) {
        var b = a.H();
        Pn ? a.H().placeholder != a.e && (a.H().placeholder = a.e) : (Qn(a), b.setAttribute("aria-label", a.e));
        Sn(a) ? (b = a.H(), An(b, "label-input-label")) : (!a.C && !a.Pb && (b = a.H(), zn(b, "label-input-label")), Pn || Kn(a.Rg, 10, a))
    }
    r.Rg = function () {
        this.H() && (!Sn(this) && !this.Pb) && (this.H().value = this.e)
    };

    function Tn(a, b, c) {
        this.b = a;
        this.$ = b;
        R("/playlist_ajax", {
            G: {
                action_get_addto_panel: 1,
                video_id: this.$
            },
            B: function (a, b) {
                Un(this, b.html);
                c()
            },
            R: this
        })
    }
    r = Tn.prototype;
    r.ma = function () {
        Vn(this)
    };

    function Un(a, b) {
        a.b.innerHTML = b;
        a.o = N("sort-playlists", a.b);
        a.g = N("playlist-items", a.b);
        a.K = N("added-to-message", a.b);
        a.C = N("added-to-message-title", a.b);
        a.df = N("note-added-message", a.b);
        a.cf = N("note-added-message-title", a.b);
        a.i = N("create-playlist", a.b);
        if (a.i) {
            a.e = N("new-playlist-title", a.b);
            var c = a.e.getAttribute("placeholder"),
                c = new On(c),
                d = a.e;
            c.pb && g(Error("Component already rendered"));
            if (d) {
                c.Bd = m;
                if (!c.i || c.i.b != Qc(d)) c.i = Oc(d);
                c.Sc(d);
                c.cc()
            } else g(Error("Invalid element to decorate"));
            a.ga = N("create-new-playlist", a.b)
        }
        a.Aa = U(a.o, "change", v(a.ff, a));
        a.ba = U(a.i, "submit", v(a.lf, a));
        a.j = W(a.b, "click", v(a.hf, a), "playlist-item-favorite");
        a.A = W(a.b, "click", v(a.jf, a), "playlist-item");
        a.pa = W(a.b, "click", v(a.kf, a), "save-note");
        a.U = W(a.b, "click", v(a.gf, a), "cancel-note");
        a.Ba = U(a.e, "keyup", v(a.mf, a));
        Wn(a, a.o.value);
        ai()
    }
    function Vn(a) {
        V(a.Aa);
        V(a.ba);
        V(a.j);
        V(a.A);
        V(a.pa);
        V(a.U);
        V(a.Ba)
    }
    r.ff = function (a) {
        a = a.currentTarget.value;
        Wn(this, a);
        R("/playlist_ajax?action_update_addto_sort_criteria=1", {
            G: {
                criteria: a
            }
        })
    };

    function Wn(a, b) {
        var c = {
            created: a.dh,
            privacy: a.eh,
            "a-z": a.Je,
            "z-a": a.fh
        }[b];
        if (c) {
            var d = Ya(M("playlist-item", a.g)),
                e = N("playlist-item-favorite", a.g);
            d.push(e);
            Xn(a, d.sort(v(c, a)))
        }
    }
    function Xn(a, b) {
        var c = document.createDocumentFragment();
        z(b, function (a) {
            c.appendChild(a)
        });
        cd(a.g);
        bd(a.g, c)
    }
    r.eh = function (a, b) {
        var c = T(a, "is-private") || "",
            d = T(b, "is-private") || "";
        return ta(c, d)
    };
    r.dh = function (a, b) {
        function c(a) {
            return gg(a, "time-created") ? (a = T(a, "time-created"), parseInt(a, 10)) : (new Date).getTime() / 1E3
        }
        return c(b) - c(a)
    };
    r.Je = function (a, b) {
        var c = T(a, "title") || "",
            d = T(b, "title") || "";
        return ta(c, d)
    };
    r.fh = function (a, b) {
        return this.Je(b, a)
    };
    r.lf = function (a) {
        a.preventDefault();
        a = N("create-playlist", this.b);
        sa(this.e.value) || Yn(this, a)
    };

    function Yn(a, b) {
        I(b, "loading");
        Re(b, {
            R: a,
            B: function (a, d) {
                J(b, "loading");
                d.html ? (Vn(this), Un(this, d.html)) : d.errors && Zn(this, d.errors[0])
            }
        })
    }

    function Zn(a, b) {
        var c = N("added-to-error-message", a.b);
        N("yt-alert-content", c).innerHTML = b;
        X(c)
    }
    r.hf = function (a) {
        a.stopPropagation();
        $n(this, a.currentTarget)
    };

    function $n(a, b) {
        I(b, "loading");
        R("/addto_ajax", {
            method: "POST",
            format: "XML",
            G: {
                action_add_to_favorites: 1
            },
            F: {
                video_ids: a.$,
                session_token: C("addto_ajax"),
                plid: B("PLAYBACK_ID")
            },
            R: a,
            B: function (a, d) {
                J(b, "loading");
                ao(this, b);
                bo(b);
                "True" == d.show_feed_privacy_dialog && F("SHOW-FAVORITE-DIALOG", this.$)
            },
            onError: function (a, d) {
                J(b, "loading");
                Zn(this, d.error_message)
            }
        })
    }
    r.jf = function (a) {
        var b = a.currentTarget;
        K(b, "selected") || (a.stopPropagation(), co(this), eo(this, b))
    };

    function eo(a, b) {
        var c = T(b, "playlist-id"),
            d = L("playlist-addto-top-checkbox").checked ? "True" : "False";
        I(b, "loading");
        R("/addto_ajax", {
            method: "POST",
            format: "XML",
            G: {
                action_add_to_playlist: 1
            },
            F: {
                playlist_id: c,
                video_ids: a.$,
                session_token: C("addto_ajax"),
                plid: B("PLAYBACK_ID"),
                add_to_top: d
            },
            R: a,
            B: function (a, c) {
                this.pe = c.setvideo_id;
                J(b, "loading");
                I(b, "selected");
                ao(this, b);
                bo(b)
            }
        })
    }
    function bo(a) {
        a = N("playlist-video-count", a);
        a.innerHTML = parseInt(a.innerHTML, 10) + 1
    }
    r.kf = function (a) {
        a.preventDefault();
        a = Q(a.currentTarget, "playlist-note-form");
        fo(this, a)
    };
    r.gf = function () {
        co(this)
    };

    function fo(a, b) {
        I(b, "loading");
        Re(b, {
            F: {
                session_token: C("playlist_bar_ajax"),
                setvideo_id: a.pe
            },
            R: a,
            B: function () {
                co(this);
                J(b, "loading");
                var a = N("playlist-name", b);
                this.cf.innerHTML = a.value;
                a = this.df;
                this.Zb && Y(this.Zb);
                this.Zb = a;
                X(a)
            },
            onError: function (a, d) {
                J(b, "loading");
                Zn(this, d.errors[0])
            }
        })
    }
    function co(a) {
        var b = N("selected", a.b);
        b && (J(b, "selected"), a.pe = n)
    }

    function ao(a, b) {
        a.C.innerHTML = T(b, "title");
        var c = a.K;
        a.Zb && Y(a.Zb);
        a.Zb = c;
        X(c);
        F("PLAYLIST_UPDATED")
    }
    r.mf = function () {
        this.ga.disabled = sa(this.e.value)
    };
    var go, ho = [];

    function io(a, b) {
        var c = b.response.guide_notification_html_content;
        c && jo(c)
    }

    function jo(a) {
        if (L("guide-subscriptions-promo")) F("replace-no-subs-promo");
        else {
            var b = document.createElement("ul");
            b.innerHTML = a;
            a = jd(b);
            z(a, function (a) {
                I(a, "guide-notification-new");
                var b = N("guide-item", a),
                    e = T(b, "channel-id");
                e && ko(e) == n && (ed(Ym, a), lo(), D(function () {
                    J(a, "guide-notification-new");
                    e == B("CHANNEL_ID") && I(b, "guide-item-selected")
                }, tj(a)), mo(a), no(L("collapsed-guide-sub-notification"), a))
            })
        }
        a = b = n
    }

    function oo(a) {
        if (a = ko(a)) Gc ? a = a.parentElement : (a = a.parentNode, a = ka(a) && 1 == a.nodeType ? a : n), fd(a);
        lo();
        (a = L("collapsed-guide-sub-notification")) && J(a, "guide-notification")
    }
    function po() {
        var a = L("watch-later-guide-item");
        mo(a, m);
        no(L("collapsed-guide-watch-later-notification"), a)
    }
    function qo() {
        var a = L("playlists-guide-item");
        mo(a, m);
        no(L("collapsed-guide-playlist-notification"), a)
    }

    function mo(a, b) {
        F("guide-show-notification");
        I(a, "guide-notification");
        var c = N("guide-item", a);
        if (b) {
            var d = T(a, "notification-text") || ud(c),
                e = c.innerHTML;
            cd(c);
            pd(c, d)
        }
        var f = Xc("span", {
            className: "guide-notification-icon"
        });
        c.appendChild(f);
        D(function () {
            I(a, "guide-notification-enabled")
        }, 0);
        D(function () {
            J(a, "guide-notification-enabled");
            b ? c.innerHTML = e : fd(f);
            D(function () {
                J(a, "guide-notification")
            }, tj(c))
        }, 3E3)
    }

    function no(a, b) {
        var c = L("guide-main"),
            d = K(c, "collapsed");
        go || (go = N("guide-notifications-collapsed", c));
        if (d && go) {
            ro.push(b);
            I(go, "guide-notification");
            K(a, "guide-notification") || (d = fd(a), ed(go, d), I(a, "guide-notification-new"));
            var e = N("guide-module-toggle-icon", c);
            I(a, "guide-notification");
            I(e, "guide-notification");
            D(function () {
                I(a, "guide-notification-enabled");
                I(e, "guide-notification-enabled");
                D(function () {
                    J(a, "guide-notification-new")
                }, tj(a))
            }, 0);
            D(function () {
                J(a, "guide-notification-enabled");
                J(e, "guide-notification");
                J(e, "guide-notification-enabled")
            }, 3E3)
        }
    }
    function so() {
        z(ro, function (a) {
            I(a, "guide-notification");
            D(function () {
                I(a, "guide-notification-delayed")
            }, 0);
            D(function () {
                J(a, "guide-notification-delayed");
                var b = N("guide-item", a);
                D(function () {
                    J(a, "guide-notification")
                }, tj(b))
            }, 3E3)
        });
        ro = []
    }
    function to() {
        if (go) {
            J(go, "guide-notification");
            var a = M("collapsed-guide-notification", go);
            z(a, function (a) {
                J(a.parentNode, "guide-notification")
            })
        }
    }
    var ro = [];

    function uo(a) {
        a = 1166 > a.width;
        var b = !Xm;
        b && K(document.body, "site-left-aligned") && (b = a);
        if (b && K(document.body, "sidebar-expanded") || !b && K(document.body, "sidebar-collapsed")) b ? Lc(document.body, "sidebar-expanded", "sidebar-collapsed") : Lc(document.body, "sidebar-collapsed", "sidebar-expanded"), a = He({
                expanded: !b,
                "page-class": Vm.className
            }), Df("sidebar-toggled", a, h)
    };
    var vo = [],
        wo = [],
        xo = p,
        yo = "",
        zo = p;

    function Ao() {
        Vm = L("page");
        Wm = L("guide");
        Ym = L("guide-channels");
        an = L("guide-container");
        "placeholder" in document.createElement("input") || ($m = L("guide-quick-filter-label"));
        bn = N("guide-view-all", Wm);
        if (Wm) {
            Xm = K(document.body, "guide-collapsed");
            Ym = L("guide-channels");
            cn.push(W(n, "click", dn, "collection-save-button"));
            cn.push(W(n, "click", hn, "collection-delete-button"));
            cn.push(W(n, "click", jn, "subscription-list-item"));
            ho.push(E("guide-add-subscription", jo));
            ho.push(E("SUBSCRIBE", io));
            ho.push(E("subscription-unsubscribe-success",
                oo));
            ho.push(E("UNSUBSCRIBE", oo));
            ho.push(E("WATCH_LATER_UPDATED", po));
            ho.push(E("player-watchlater", po));
            ho.push(E("PLAYLIST_UPDATED", qo));
            vo.push(W(Wm, "keyup", Bo, "guide-quick-filter"));
            vo.push(W(Wm, "click", Co, "guide-quick-filter-clear"));
            vo.push(W(Wm, "click", Do, "guide-sort-choice"));
            vo.push(W(an, "click", Eo, "guide-module-toggle"));
            var a = M("guide-channels-list");
            Xm || z(a, function (a) {
                Oj(a)
            });
            a = Uc(window);
            Fo(a);
            wo.push(E("page-resize", Fo));
            wo.push(E("replace-no-subs-promo", Go));
            wo.push(E("show-subscriptions-promo",
                Ho));
            wo.push(E("update-guide-subs-and-footer", Io));
            K(Vm, "watch") && (uo(a), wo.push(E("page-resize", uo)), wo.push(E("guide-show-notification", Jo)))
        }
    }
    function Ko() {
        V(vo);
        vo = [];
        V(cn);
        cn = [];
        Wb(ho)
    }
    function Lo(a) {
        (Xm = a) ? Lc(document.body, "guide-expanded", "guide-collapsed") : Lc(document.body, "guide-collapsed", "guide-expanded");
        if (K(Vm, "watch") && (uo(Uc(window)), !a && (a = L("watch-context-item-list")))) {
            var b = T(a, "context-playing");
            (b = parseInt(b, 10)) && Ii(Gi.getInstance(), a, b)
        }
    }

    function Bo() {
        var a = N("guide-quick-filter", Wm),
            b = N("guide-quick-filter-clear", Wm);
        if (yo != a.value) {
            yo = a.value;
            var c = 0 < a.value.length;
            Jg(b, c);
            $m && c && Y($m);
            bn && !xo ? Mo() : No(a, 100)
        }
    }
    function Co() {
        var a = N("guide-quick-filter", Wm),
            b = N("guide-quick-filter-clear", Wm);
        a.value = "";
        Y(b);
        $m && X($m);
        No(a, 100)
    }

    function No(a, b) {
        var c = a.value,
            d = RegExp(c, "i"),
            e = L("guide-channels"),
            f = M("display-name", e),
            k = p;
        if (c) {
            var l = Yf(Ym).height;
            Ym.style.height = l + "px"
        } else Ym.style.height = "auto";
        var q = 0;
        z(f, function (a) {
            var e = Q(a, "guide-item").getAttribute("title"),
                f = d.test(e);
            Jg(wd(a, "li", "guide-channel"), f);
            f && (k = m, q++);
            a.innerHTML = f && !sa(c) ? e.replace(d, '<span class="filter-match">' + c + "</span>") : e;
            b && q > b && Jg(wd(a, "li", "guide-channel"), p)
        });
        Mc(e, "filter-has-matches", k);
        c && !Zm && (Df("guide-filter", h, h), Zm = m)
    }

    function Do(a) {
        var b = N("guide-sort-button"),
            c = T(b, "guide-sort") || "";
        a = T(a.currentTarget, "guide-sort") || "";
        c != a && (xo = p, S(b, "guide-sort", a), R("/guide_channels_ajax?action_set_guide_sort=1", {
            method: "POST",
            G: {
                sort: a
            },
            F: {
                session_token: C("guide_channels_ajax")
            },
            format: "JSON",
            B: function (a, b) {
                Oo(b)
            }
        }))
    }
    function Po() {
        xo = p
    }

    function Oo(a) {
        L("guide-subscriptions-container").innerHTML = a.channels;
        lo();
        a = M("yt-uix-tooltip-tip-visible");
        z(a, function (a) {
            J(a, "yt-uix-tooltip-tip-visible")
        });
        a = N("guide-quick-filter", Wm);
        J(an, "filter-loading");
        No(a, n)
    }

    function Mo() {
        var a = N("guide-sort-button"),
            a = T(a, "guide-sort") || "";
        I(an, "filter-loading");
        xo = m;
        R("/guide_channels_ajax?action_load_all_subscriptions=1", {
            method: "POST",
            G: {
                sort: a
            },
            F: {
                session_token: C("guide_channels_ajax")
            },
            format: "JSON",
            B: function (a, c) {
                Oo(c);
                D(Po, 12E4)
            },
            onError: function () {
                xo = p
            }
        })
    }
    function lo() {
        "placeholder" in document.createElement("input") || ($m = L("guide-quick-filter-label"));
        Ym = L("guide-channels");
        M("guide-section", an);
        Xm || Oj(Ym)
    }

    function ko(a) {
        var b = M("guide-item", Wm);
        return Qa(b, function (b) {
            return T(b, "channel-id") == a
        })
    }
    function Eo(a) {
        var b = Q(a.currentTarget, "guide-module");
        "true" == T(b, "pending-click") ? a.preventDefault() : (S(b, "pending-click", "true"), D(function () {
            fg(b, "pending-click")
        }, 500), K(b, "collapsed") ? (a.preventDefault(), a = Qo(b), Ro(b.id, !a, p), so()) : Q(a.target, "guide-module-toggle-icon") && (a = Qo(b), Ro(b.id, !a, p)))
    }

    function Ro(a, b, c, d) {
        b = {
            "module-id": a,
            expanded: b,
            auto: c,
            "page-class": Vm.className,
            notification: d || p
        };
        "watch-context-container" == a && (a = T(L("watch-context-container"), "context-type")) && (b["context-type"] = a);
        a = He(b);
        Df("guide-toggled", a, h)
    }

    function Qo(a) {
        var b = N("guide-module-content", a),
            c = Nc(a, "collapsed"),
            d = tj(b);
        a == L("guide-main") && (N("guide-module-toggle-label", a), to());
        c ? (Xf(b, 0), D(function () {
            Y(b);
            Xf(b, "auto")
        }, d)) : (d = Yf(b).height, Xf(b, 0), Pg(b, "display", "block"), Xf(b, d), Oj(a));
        a = M("guide-module", an);
        a = Pa(a, function (a) {
            return K(a, "collapsed")
        });
        Lo(a);
        return c
    }

    function Ho(a) {
        var b = L("guide-main"),
            c = 0;
        K(b, "collapsed") && (Qo(b), c = tj(N("guide-module-content", b)));
        D(function () {
            var b = L("guide-subscriptions-section"),
                c = ad(a);
            bd(b, c);
            I(b, "yt-uix-clickcard");
            S(b, "orientation", "vertical");
            S(b, "position", "topright");
            S(b, "force-position", "true");
            S(b, "click-outside-persists", "true");
            S(b, "card-class", "guide-subscriptions-promo");
            Hh.getInstance().show(b)
        }, c)
    }
    function Fo(a) {
        return zo = a = 1166 <= a.width
    }

    function Go() {
        R("/guide_channels_ajax?action_load_subs_and_footer=1", {
            format: "JSON",
            B: function (a, b) {
                Io(b.channels)
            }
        })
    }
    function Io(a) {
        fd(L("guide-subscriptions-promo"));
        L("guide-subs-footer-container").innerHTML = a;
        lo()
    }
    function Jo() {
        var a = L("guide-main");
        if (K(a, "collapsed") && zo) {
            var b = Qo(a);
            Ro(a.id, !b, m, m)
        }
    };

    function So() {
        To(function () {})
    }

    function To(a) {
        a = {
            Z: B("WATCH_LATER_VIDEO_ID_TO_LOAD"),
            ah: "WL",
            Ie: h,
            B: a,
            onError: h,
            R: h
        };
        var b = {
            video_ids: a.Z,
            playlist_id: a.oi || "",
            new_playlist_name: a.bh || "",
            session_token: C("addto_ajax")
        }, c = B("PLAYBACK_ID");
        c && (b.plid = c);
        c = {};
        a.$g && (c["private"] = a.$g);
        a.Ie && (c.feature = a.Ie);
        var d = "";
        switch (a.ah) {
            case "PL":
                d = a.bh ? "action_add_to_new_playlist" : "action_add_to_playlist";
                break;
            case "FL":
                d = "action_add_to_favorites";
                break;
            case "WL":
                d = "action_add_to_watch_later_list"
        }
        c[d] = 1;
        R("/addto_ajax", {
            He: m,
            format: "XML",
            method: "POST",
            G: c,
            F: b,
            R: a.R,
            onError: a.onError,
            B: a.B
        })
    };

    function Uo(a, b, c) {
        this.j = a;
        this.e = b;
        this.o = c;
        this.i = L("logo");
        this.A = Yf(this.i).width;
        a = Rc("map", n, L("logo-container"))[0];
        U(a, "mouseover", v(this.zg, this));
        U(a, "mouseout", v(this.yg, this));
        setTimeout(v(this.Ag, this), this.o)
    }
    var Vo = 1E3 / 30;
    r = Uo.prototype;
    r.sc = p;
    r.ed = p;
    r.od = p;
    r.zg = function () {
        this.od = m;
        !this.sc && this.ed && this.$c()
    };
    r.yg = function () {
        this.od = p;
        !this.sc && this.ed && (clearTimeout(this.g), this.b = n, Wo(this, 0))
    };

    function Wo(a, b) {
        Pg(a.i, "backgroundPosition", b + "px 0")
    }
    r.$c = function () {
        this.g = setTimeout(v(this.$c, this), Vo);
        var a = w();
        this.b = this.b || a;
        Wo(this, -Math.floor((a - this.b || 1) % this.e / this.e * this.j) * this.A)
    };
    r.Ag = function () {
        this.ed = this.sc = m;
        this.$c();
        setTimeout(v(this.Wg, this), this.e)
    };
    r.Wg = function () {
        this.od || (clearTimeout(this.g), this.b = n, Wo(this, 0));
        this.sc = p
    };
    var Xo, Yo, Zo;

    function $o() {
        if (Xo = L("masthead-appbar")) Yo = L("header"), Zo = L("masthead-positioner"), ap.push(E("masthead-mastfeedr-toggle", bp))
    }
    function cp() {
        V(dp);
        dp = [];
        Wb(ap);
        ap = [];
        Zo = Yo = Xo = n
    }
    function bp() {
        Yo.style.marginTop = Yf(Zo).height + "px"
    }
    var dp = [],
        ap = [];
    var ep = window,
        fp = document,
        gp = ep.location;

    function hp() {}
    var ip = /\[native code\]/;

    function jp(a, b, c) {
        return a[b] = a[b] || c
    }
    function kp(a) {
        for (var b = 0; b < this.length; b++) if (this[b] === a) return b;
        return -1
    }
    function lp(a) {
        a = a.sort();
        for (var b = [], c = h, d = 0; d < a.length; d++) {
            var e = a[d];
            e != c && b.push(e);
            c = e
        }
        return b
    }
    function mp() {
        var a;
        if ((a = Object.create) && ip.test(a)) a = a(n);
        else {
            a = {};
            for (var b in a) a[b] = h
        }
        return a
    }
    var np = jp(ep, "gapi", {});
    var op;
    op = jp(ep, "___jsl", mp());
    jp(op, "I", 0);
    jp(op, "hel", 10);

    function pp() {
        var a = gp.href,
            b;
        if (op.dpo) b = op.h;
        else {
            b = op.h;
            var c = RegExp("([#].*&|[#])jsh=([^&#]*)", "g"),
                d = RegExp("([?#].*&|[?#])jsh=([^&#]*)", "g");
            if (a = a && (c.exec(a) || d.exec(a))) try {
                    b = decodeURIComponent(a[2])
            } catch (e) {}
        }
        return b
    }
    function qp(a) {
        var b = jp(op, "PQ", []);
        op.PQ = [];
        var c = b.length;
        if (0 === c) a();
        else for (var d = 0, e = function () {
                    ++d === c && a()
                }, f = 0; f < c; f++) b[f](e)
    }
    function rp(a) {
        return jp(jp(op, "H", mp()), a, mp())
    };
    var sp = jp(op, "perf", mp());
    jp(sp, "g", mp());
    var tp = jp(sp, "i", mp());
    jp(sp, "r", []);
    mp();
    mp();

    function up(a, b, c) {
        b && 0 < b.length && (b = vp(b), c && 0 < c.length && (b += "___" + vp(c)), 28 < b.length && (b = b.substr(0, 28) + (b.length - 28)), c = b, b = jp(tp, "_p", mp()), jp(b, c, mp())[a] = (new Date).getTime(), b = sp.r, "function" === typeof b ? b(a, "_p", c) : b.push([a, "_p", c]))
    }
    function vp(a) {
        return a.join("__").replace(/\./g, "_").replace(/\-/g, "_").replace(/\,/g, "_")
    };
    var wp = mp(),
        xp = [];

    function yp(a) {
        g(Error("Bad hint" + (a ? ": " + a : "")))
    };
    xp.push(["jsl", function (a) {
            for (var b in a) if (Object.prototype.hasOwnProperty.call(a, b)) {
                    var c = a[b];
                    "object" == typeof c ? op[b] = jp(op, b, []).concat(c) : jp(op, b, c)
                }
            if (b = a.u) a = jp(op, "us", []), a.push(b), (b = /^https:(.*)$/.exec(b)) && a.push("http:" + b[1])
        }
    ]);
    var zp = /^(\/[a-zA-Z0-9_\-]+)+$/,
        Ap = /^[a-zA-Z0-9\-_\.!]+$/,
        Bp = /^gapi\.loaded_[0-9]+$/,
        Cp = /^[a-zA-Z0-9,._-]+$/;

    function Dp(a, b, c, d) {
        var e = a.split(";"),
            f = wp[e.shift()],
            k = n;
        f && (k = f(e, b, c, d));
        if (!(b = !k)) b = k, c = b.match(Ep), d = b.match(Fp), b = !(d && 1 === d.length && Gp.test(b) && c && 1 === c.length);
        b && yp(a);
        return k
    }

    function Hp(a, b, c, d) {
        function e(a) {
            return encodeURIComponent(a).replace(/%2C/g, ",")
        }
        a = Ip(a);
        Bp.test(c) || yp("invalid_callback");
        b = Jp(b);
        d = d && d.length ? Jp(d) : n;
        return [encodeURIComponent(a.Eh).replace(/%2C/g, ",").replace(/%2F/g, "/"), "/k=", e(a.version), "/m=", e(b), d ? "/exm=" + e(d) : "", "/rt=j/sv=1/d=1/ed=1", a.Se ? "/am=" + e(a.Se) : "", a.Te ? "/rs=" + e(a.Te) : "", "/cb=", e(c)].join("")
    }

    function Ip(a) {
        "/" !== a.charAt(0) && yp("relative path");
        for (var b = a.substring(1).split("/"), c = []; b.length;) {
            a = b.shift();
            if (!a.length || 0 == a.indexOf(".")) yp("empty/relative directory");
            else if (0 < a.indexOf("=")) {
                b.unshift(a);
                break
            }
            c.push(a)
        }
        a = {};
        for (var d = 0, e = b.length; d < e; ++d) {
            var f = b[d].split("="),
                k = decodeURIComponent(f[0]),
                l = decodeURIComponent(f[1]);
            2 != f.length || (!k || !l) || (a[k] = a[k] || l)
        }
        b = "/" + c.join("/");
        zp.test(b) || yp("invalid_prefix");
        c = Kp(a, "k", m);
        d = Kp(a, "am");
        a = Kp(a, "rs");
        return {
            Eh: b,
            version: c,
            Se: d,
            Te: a
        }
    }
    function Jp(a) {
        for (var b = [], c = 0, d = a.length; c < d; ++c) {
            var e = a[c].replace(/\./g, "_").replace(/-/g, "_");
            Cp.test(e) && b.push(e)
        }
        return b.join(",")
    }
    function Kp(a, b, c) {
        a = a[b];
        !a && c && yp("missing: " + b);
        if (a) {
            if (Ap.test(a)) return a;
            yp("invalid: " + b)
        }
        return n
    }
    var Gp = /^https?:\/\/[a-z0-9_.-]+\.google\.com(:\d+)?\/[a-zA-Z0-9_.,!=\-\/]+$/,
        Fp = /\/cb=/g,
        Ep = /\/\//g;

    function Lp() {
        var a = pp();
        a || g(Error("Bad hint"));
        return a
    }
    wp.m = function (a, b, c, d) {
        (a = a[0]) || yp("missing_hint");
        return "https://apis.google.com" + Hp(a, b, c, d)
    };
    var Mp = decodeURI("%73cript");

    function Np(a, b) {
        for (var c = [], d = 0; d < a.length; ++d) {
            var e = a[d];
            e && 0 > kp.call(b, e) && c.push(e)
        }
        return c
    }
    function Op(a) {
        "loading" != fp.readyState ? Pp(a) : fp.write("<" + Mp + ' src="' + encodeURI(a) + '"></' + Mp + ">")
    }
    function Pp(a) {
        var b = fp.createElement(Mp);
        b.setAttribute("src", a);
        b.async = "true";
        (a = fp.getElementsByTagName(Mp)[0]) ? a.parentNode.insertBefore(b, a) : (fp.head || fp.body || fp.documentElement).appendChild(b)
    }

    function Qp(a, b) {
        var c = b && b._c;
        if (c) for (var d = 0; d < xp.length; d++) {
                var e = xp[d][0],
                    f = xp[d][1];
                f && Object.prototype.hasOwnProperty.call(c, e) && f(c[e], a, b)
        }
    }
    function Rp(a, b) {
        Sp(function () {
            var c;
            c = b === pp() ? jp(np, "_", mp()) : mp();
            c = jp(rp(b), "_", c);
            a(c)
        })
    }

    function Tp(a, b) {
        var c = b || {};
        "function" == typeof b && (c = {}, c.callback = b);
        Qp(a, c);
        var d = a ? a.split(":") : [],
            e = c.h || Lp(),
            f = jp(op, "ah", mp());
        if (!f["::"] || !d.length) Up(d || [], c, e);
        else {
            for (var k = [], l = n; l = d.shift();) {
                var q = l.split("."),
                    q = f[l] || f[q[1] && "ns:" + q[0] || ""] || e,
                    A = k.length && k[k.length - 1] || n,
                    H = A;
                if (!A || A.hint != q) H = {
                        hint: q,
                        Ze: []
                }, k.push(H);
                H.Ze.push(l)
            }
            var O = k.length;
            if (1 < O) {
                var P = c.callback;
                P && (c.callback = function () {
                    0 == --O && P()
                })
            }
            for (; d = k.shift();) Up(d.Ze, c, d.hint)
        }
    }

    function Up(a, b, c) {
        function d(a, b) {
            if (A) return 0;
            ep.clearTimeout(q);
            O.push.apply(O, ba);
            var d = ((np || {}).config || {}).update;
            d ? d(f) : f && jp(op, "cu", []).push(f);
            if (b) {
                up("me0", a, P);
                try {
                    Rp(b, c)
                } finally {
                    up("me1", a, P)
                }
            }
            return 1
        }
        a = lp(a) || [];
        var e = b.callback,
            f = b.config,
            k = b.timeout,
            l = b.ontimeout,
            q = n,
            A = p;
        (k && !l || !k && l) && g("Timeout requires both the timeout parameter and ontimeout parameter to be set");
        var H = jp(rp(c), "r", []).sort(),
            O = jp(rp(c), "L", []).sort(),
            P = [].concat(H);
        0 < k && (q = ep.setTimeout(function () {
            A = m;
            l()
        },
            k));
        var ba = Np(a, O);
        if (ba.length) {
            var ba = Np(a, H),
                Xa = jp(op, "CP", []),
                nb = Xa.length;
            Xa[nb] = function (a) {
                function b() {
                    var a = Xa[nb + 1];
                    a && a()
                }
                function c(b) {
                    Xa[nb] = n;
                    d(ba, a) && qp(function () {
                        e && e();
                        b()
                    })
                }
                if (!a) return 0;
                up("ml1", ba, P);
                0 < nb && Xa[nb - 1] ? Xa[nb] = function () {
                    c(b)
                } : c(b)
            };
            if (ba.length) {
                var Ha = "loaded_" + op.I++;
                np[Ha] = function (a) {
                    Xa[nb](a);
                    np[Ha] = n
                };
                a = Dp(c, ba, "gapi." + Ha, H);
                H.push.apply(H, ba);
                up("ml0", ba, P);
                b.sync || ep.___gapisync ? Op(a) : Pp(a)
            } else Xa[nb](hp)
        } else d(ba) && e && e()
    };

    function Sp(a) {
        if (op.hee && 0 < op.hel) try {
                return a()
        } catch (b) {
            op.hel--, Tp("debug_error", function () {
                window.___jsl.hefn(b)
            })
        } else return a()
    };
    np.load = function (a, b) {
        return Sp(function () {
            return Tp(a, b)
        })
    };
    var Vp = p;
    var Wp = -2;

    function Xp() {
        if (-2 == Wp) {
            Wp = parseInt(Pi("ACTIVITY", "-1"), 10);
            U(document, "keypress", Yp);
            U(document, "click", Zp);
            var a = B("LIST_AUTO_PLAY_VALUE");
            a && 1 < a || $p()
        }
    }
    function Yp() {
        $p()
    }
    function Zp() {
        $p()
    }
    function $p() {
        Xp();
        var a = w();
        1E3 > a - Wp || (Wp = a, Oi("ACTIVITY", "" + a))
    }
    function aq() {
        return -1 == Wp || -2 == Wp ? -1 : Math.max(w() - Wp, 0)
    };

    function bq(a, b, c, d, e, f) {
        this.b = n;
        this.C = c;
        this.i = a;
        this.A = b;
        this.g = d;
        this.j = B("GOOGLEPLUS_HOST") + (e != n ? "/u/" + e : "") + (f != n ? "/b/" + f : "") + "/_/notifications/frame#pid=36";
        this.o = L(a)
    }
    function cq(a, b, c, d) {
        return {
            onOpen: v(function (a) {
                return a.openInto(c)
            }, a),
            onReady: v(function () {
                b.showOnepick && d && b.showOnepick()
            }, a),
            onClose: function (a) {
                b.hideOnepick && d && b.hideOnepick();
                a.remove()
            }
        }
    }
    function dq(a, b, c) {
        if ("undefined" === typeof c) a[b]();
        else a[b](c)
    }

    function eq(a, b) {
        var c = {
            setNotificationWidgetHeight: v(function (a) {
                this.o.style.height = a
            }, a),
            setNotificationText: v(function (a) {
                this.C(parseInt(a, 10))
            }, a),
            hideNotificationWidget: function () {
                b.hideNotificationWidget && b.hideNotificationWidget()
            },
            openSharebox: function () {},
            onError: function () {}
        };
        a.b = iframes.open(a.j, {
            style: "iframe-style"
        }, {
            origin: window.location.protocol + "//" + window.location.hostname,
            source: "yt",
            hl: a.g
        }, c, function () {})
    }
    bq.prototype.load = function (a) {
        iframes.setHandler("iframe-style", cq(this, a, this.i, p));
        iframes.setHandler("onepick", cq(this, a, this.A, m));
        eq(this, a)
    };
    bq.prototype.close = function () {
        dq(this.b, "onHide")
    };
    bq.prototype.e = function () {
        return Uc(window).height - 60 - 20
    };

    function fq(a, b) {
        b ? dq(a.b, "onActive") : dq(a.b, "onIdle")
    };

    function gq(a, b, c) {
        this.g = this.e = p;
        this.j = 0;
        this.D = L("sb-container");
        this.i = L("sb-button-notify");
        this.A = og("SPAN", "yt-uix-button-content", L("sb-button-notify"));
        this.o = L("sb-onepick-target");
        this.b = new bq("sb-target", "sb-onepick-target", v(this.uf, this), a, b, c);
        this.b.load({
            hideNotificationWidget: v(this.Gd, this),
            showOnepick: v(this.tf, this),
            hideOnepick: v(this.sf, this)
        });
        this.C = Yf(this.o);
        this.Hd();
        U(window, "resize", v(this.Hd, this));
        U(window, "click", v(this.Gd, this));
        Xp();
        Pb(v(this.rf, this), 12E4)
    }
    r = gq.prototype;
    r.ai = function (a) {
        if (this.e) hq(this), fq(this.b, m);
        else {
            this.g && iq(this);
            this.b.close();
            jq(this, m, "notif");
            I(this.i, "sb-notif-clicked");
            var b = this.b,
                c = {
                    maxWidgetHeight: b.e()
                };
            dq(b.b, "onShowNotificationsOnly", c);
            this.e = m;
            fq(this.b, p)
        }
        Cg(a)
    };
    r.bi = function (a) {
        if (this.g) iq(this);
        else {
            this.e && hq(this);
            this.b.close();
            jq(this, m, "sharebox");
            var b = this.b,
                c = window.location.href; - 1 != c.indexOf("/watch?") && dq(b.b, "setPrefill", {
                items: [{
                        type: "http://schema.org/VideoObject",
                        id: c,
                        properties: {
                            url: [c]
                        }
                    }
                ]
            });
            dq(b.b, "onShowShareboxOnly", {
                maxWidgetHeight: b.e
            });
            this.g = m
        }
        Cg(a)
    };

    function jq(a, b, c) {
        c = "sb-card-" + c;
        b ? (Lc(a.D, "sb-off", "sb-on"), I(a.D, c)) : (Lc(a.D, "sb-on", "sb-off"), J(a.D, c))
    }
    function iq(a) {
        jq(a, p, "sharebox");
        a.g = p
    }

    function hq(a) {
        jq(a, p, "notif");
        a.e = p;
        J(a.i, "sb-notif-clicked")
    }
    r.Gd = function () {
        if (this.e || this.g) this.b.close(), hq(this), iq(this), kq(this)
    };
    r.uf = function (a) {
        this.j = a;
        kq(this)
    };

    function kq(a) {
        pd(a.A, a.j + "");
        0 == a.j ? Lc(a.i, "sb-notif-on", "sb-notif-off") : Lc(a.i, "sb-notif-off", "sb-notif-on")
    }
    r.tf = function () {
        Lc(this.o, "sb-off", "sb-on")
    };
    r.sf = function () {
        Lc(this.o, "sb-on", "sb-off")
    };
    r.Hd = function () {
        var a = Math.max((Uc(window).height - this.C.height) / 2, 0);
        Jf(this.o, "top", a + "px")
    };
    r.rf = function () {
        6E5 < aq() ? fq(this.b, p) : fq(this.b, m)
    };

    function lq() {
        Tp("iframes", {
            callback: function () {
                var a = L("sb-button-notify"),
                    b = L("sb-button-share"),
                    c = new gq(B("SANDBAR_LOCALE"), B("SESSION_INDEX"), B("SANDBAR_DELEGATED_SESSION_ID"));
                U(a, "click", v(c.ai, c));
                U(b, "click", v(c.bi, c));
                F("sandbar-init")
            },
            _c: {
                jsl: {
                    h: B("GAPI_HINT_PARAMS")
                }
            }
        })
    };

    function mq() {
        E("subscription-subscribe", nq);
        E("subscription-unsubscribe", oq);
        E("subscription-batch-subscribe", pq);
        E("subscription-batch-unsubscribe", qq);
        E("subscription-pref-email", rq);
        E("subscription-pref-uploads", sq);
        E("subscription-prefs", tq);
        E("subscription-batch-pref-email", uq);
        E("subscription-batch-pref-uploads", vq);
        E("ypc-purchase-success", wq);
        E("ypc-subscription-cancel-success", xq)
    }

    function nq(a, b, c, d) {
        b ? F("ypc-delayedloader-load", function () {
            F("ypc-init-purchase-for-item", b)
        }) : yq(a, c, d)
    }
    function oq(a, b, c, d, e) {
        c ? F("ypc-delayedloader-load", function () {
            F("ypc-subscription-cancel", c)
        }) : zq(a, b, d, e)
    }

    function pq(a) {
        if (a.length) {
            var b = $a(a, 0, 40);
            F("subscription-batch-subscribe-loading", b);
            Aq("subscription-subscribe-loading", b);
            var c = {};
            c.session_token = C("subscription_ajax");
            c.a = b.join(",");
            var d = function () {
                F("subscription-batch-subscribe-loaded", b);
                Aq("subscription-subscribe-loaded", b)
            };
            R("/subscription_ajax?action_create_subscription_to_all=1", {
                method: "POST",
                F: c,
                B: function (c, f) {
                    d();
                    var k = f.response,
                        l = k.id;
                    if (ga(l) && l.length == b.length) {
                        var q = {};
                        z(l, function (a, c) {
                            q[b[c]] = a
                        });
                        F("subscription-batch-subscribe-success",
                            q);
                        fb(q, function (a, b) {
                            F("subscription-subscribe-success", b, a)
                        });
                        (k = k.guide_notification_html_content) && F("guide-add-subscription", k);
                        a.length && pq(a)
                    }
                },
                onError: function () {
                    d();
                    F("subscription-batch-subscribe-failure", b);
                    Aq("subscription-subscribe-failure", b)
                }
            })
        }
    }

    function qq(a) {
        if (!lb(a)) {
            var b = ib(a),
                c = $a(b, 0, 40),
                d = [];
            z(c, function (b) {
                d.push(a[b])
            });
            var e = {};
            z(b, function (b) {
                e[b] = a[b]
            });
            F("subscription-batch-unsubscribe-loading", c);
            Aq("subscription-unsubscirbe-loading", c);
            b = {};
            b.session_token = C("subscription_ajax");
            b.s = d.join(",");
            var f = function () {
                F("subscription-batch-unsubscribe-loaded", c);
                Aq("subscription-unsubscribe-loaded", c)
            };
            R("/subscription_ajax?action_remove_subscriptions=1", {
                method: "POST",
                F: b,
                B: function () {
                    f();
                    F("subscription-batch-unsubscribe-success",
                        c);
                    Aq("subscription-unsubscribe-success", c);
                    lb(e) || qq(e)
                },
                onError: function () {
                    f();
                    F("subscription-batch-unsubscribe-failure", c);
                    Aq("subscription-unsubscribe-failure", c)
                }
            })
        }
    }
    function rq(a, b, c) {
        Bq(a, b, n, c)
    }
    function sq(a, b, c) {
        Bq(a, n, b, c)
    }
    function uq(a, b, c) {
        Cq(a, b, n, c)
    }
    function vq(a, b, c) {
        Cq(a, n, b, c)
    }
    function tq(a, b, c, d) {
        Bq(a, b, c, d)
    }
    function wq(a, b, c, d) {
        a = a.subscriptionElement || n;
        (b = b.subscriptionId) && F("subscription-subscribe-success", d, b, a)
    }

    function xq(a) {
        F("subscription-unsubscribe-success", a.itemId, a.subscriptionElement || n)
    }

    function yq(a, b, c) {
        F("subscription-subscribe-loading", a);
        var d = {};
        d.c = a;
        var e = {};
        e.session_token = C("subscription_ajax");
        var f = B("PLAYBACK_ID");
        f && (e.plid = f);
        c && Dq("/subscription_ajax?action_create_subscription_to_channel=1", d, c);
        R("/subscription_ajax?action_create_subscription_to_channel=1", {
            method: "POST",
            G: d,
            F: e,
            B: function (c, d) {
                var e = d.response;
                F("subscription-subscribe-success", a, e.id, b);
                e.show_feed_privacy_dialog && F("SHOW-SUBSCRIBE-DIALOG", a);
                (e = e.guide_notification_html_content) && F("guide-add-subscription",
                    e)
            },
            onError: function () {
                F("subscription-subscribe-failure", a)
            },
            da: function () {
                F("subscription-subscribe-loaded", a)
            }
        });
        wf("subscribe")
    }

    function zq(a, b, c, d) {
        F("subscription-unsubscirbe-loading", a);
        var e = {};
        e.session_token = C("subscription_ajax");
        e.s = b;
        (b = B("PLAYBACK_ID")) && (e.plid = b);
        d && Dq("/subscription_ajax?action_remove_subscriptions=1", {}, d);
        R("/subscription_ajax?action_remove_subscriptions=1", {
            method: "POST",
            F: e,
            B: function () {
                F("subscription-unsubscribe-success", a, c)
            },
            onError: function () {
                F("subscription-unsubscribe-failure", a)
            },
            da: function () {
                F("subscription-unsubscribe-loaded", a)
            }
        });
        wf("unsubscribe")
    }

    function Bq(a, b, c, d) {
        if (b !== n || c !== n) {
            F("subscription-prefs-loading", a);
            var e = {};
            e.session_token = C("subscription_ajax");
            e.subscription_id = a;
            b === n || (e.email_on_upload = b);
            c !== n && (e.modify_uploads_only = m, e.uploads_only = c);
            R("/subscription_ajax?action_update_subscription_preferences=1", {
                method: "POST",
                F: e,
                B: function () {
                    F("subscription-prefs-success", a)
                },
                onError: function () {
                    d && d();
                    F("subscription-prefs-failure", a)
                },
                da: function () {
                    F("subscription-prefs-loaded", a)
                }
            })
        }
    }

    function Cq(a, b, c, d) {
        if (a.length && (b !== n || c !== n)) {
            var e = $a(a, 0, 40);
            F("subscription-batch-prefs-loading", e);
            var f = {};
            f.session_token = C("subscription_ajax");
            f.s = e.join(",");
            b === n || (f.email_on_upload = b);
            c === n || (f.uploads_only = c);
            var k = function () {
                F("subscription-batch-prefs-loaded", e)
            };
            R("/subscription_ajax?action_update_subscription_preferences_batch=1", {
                method: "POST",
                F: f,
                B: function () {
                    k();
                    F("subscription-batch-prefs-success", e);
                    a.length && Cq(a, b, c, d)
                },
                onError: function () {
                    k();
                    d && d();
                    F("subscription-batch-prefs-failure",
                        e)
                }
            })
        }
    }
    function Aq(a, b) {
        z(b, function (b) {
            F(a, b)
        })
    }
    function Dq(a, b, c) {
        a = Ke(a, b);
        c = Fe(c);
        Ri(a, c)
    };

    function Eq(a) {
        var b = {
            channel: "c",
            all: "a"
        };
        return b[a] || b.channel
    }
    function Fq(a) {
        var b = {
            channel: "channel",
            all: "all"
        };
        return "action_create_subscription_to_" + (b[a] || b.channel)
    };

    function Gq(a) {
        this.b = a;
        this.type = T(a, "subscription-type") || "channel";
        this.zb = T(a, "subscription-value") || "";
        this.Nb = p;
        this.i = [];
        this.e = [];
        this.nc = T(this.b, "sessionlink") || "";
        this.i.push(U(this.b, "click", v(this.Of, this)));
        this.e.push(E("SUBSCRIBE", this.Pf, this));
        this.e.push(E("UNSUBSCRIBE", this.Qf, this));
        Hq.push(this);
        Iq(this)
    }
    function Jq(a) {
        a = M("yt-subscription-button-js-default", a);
        z(a, function (a) {
            T(a, "subscription-initialized") || (new Gq(a), S(a, "subscription-initialized", "true"))
        })
    }

    function Kq() {
        z(Hq, function (a) {
            V(a.i);
            a.i = [];
            Wb(a.e);
            a.e = [];
            a.g = [];
            fg(a.b, "subscription-initialized")
        });
        Hq = []
    }
    var Hq = [];
    r = Gq.prototype;
    r.getId = function () {
        return T(this.b, "subscription-id") || n
    };

    function Lq(a, b) {
        b ? S(a.b, "subscription-id", b) : fg(a.b, "subscription-id");
        Iq(a)
    }

    function Iq(a) {
        if (gg(a.b, "subscription-button-type")) {
            var b = "-" + T(a.b, "subscription-button-type");
            Mc(a.b, "yt-uix-button-subscribed" + b, !! a.getId());
            Mc(a.b, "yt-uix-button-subscribe" + b, !a.getId())
        } else Mc(a.b, "subscribed", !! a.getId());
        a.getId() ? (b = Q(a.b, "yt-uix-button-subscription-container"), xg(b, "mouseleave", v(function () {
            I(this.b, "hover-enabled")
        }, a))) : J(a.b, "hover-enabled")
    }
    r.Of = function (a) {
        if (this.Nb) return p;
        a.preventDefault();
        this.getId() ? this.va() : this.aa()
    };
    r.disable = function () {
        "BUTTON" == this.b.tagName && I(this.b.parentNode, "yt-subscription-button-disabled-mask-container");
        this.b.disabled = m
    };
    r.enable = function () {
        J(this.b.parentNode, "yt-subscription-button-disabled-mask-container");
        this.b.disabled = p
    };
    r.aa = function () {
        var a = this.type,
            b = this.zb,
            c = T(this.b, "subscription-feature");
        this.Nb = m;
        this.disable();
        C("subscription_ajax") ? Mq(b, a, c, this) : this.b.getAttribute("href") || Ui(v(this.Ng, this))
    };
    r.Ng = function (a) {
        Ob("subscription_ajax", a.subscription_ajax);
        this.aa()
    };

    function Nq(a, b) {
        return Ma(Hq, function (c) {
            return c.type == a && c.zb == b
        })
    }
    function Mq(a, b, c, d) {
        b = b || "channel";
        var e = {};
        e[Fq(b)] = 1;
        c && (e.feature = c);
        e[Eq(b)] = a;
        if (d && d.nc) {
            c = Ke("/subscription_ajax", e);
            var f = Fe(d.nc);
            Ri(c, f)
        }
        c = {};
        c.session_token = C("subscription_ajax");
        (f = B("PLAYBACK_ID")) && (c.plid = f);
        R("/subscription_ajax", {
            method: "POST",
            G: e,
            F: c,
            B: function (c, d) {
                Oq(b, a, d)
            },
            da: function () {
                d && (d.Nb = p, d.enable())
            }
        });
        wf("subscribe")
    }

    function Oq(a, b, c) {
        var d = c || {};
        a = Nq(a, b);
        z(a, function (a) {
            F("SUBSCRIBE", b, d, a)
        });
        d.response.show_feed_privacy_dialog && F("SHOW-SUBSCRIBE-DIALOG", b)
    }
    r.va = function () {
        var a = {
            s: this.getId(),
            session_token: C("subscription_ajax")
        }, b = {
                action_remove_subscriptions: 1
            }, c = T(this.b, "subscription-feature");
        c && (b.feature = c);
        (c = B("PLAYBACK_ID")) && (a.plid = c);
        this.Nb = m;
        this.disable();
        if (this.nc) {
            var c = Ke("/subscription_ajax", b),
                d = Fe(this.nc);
            Ri(c, d)
        }
        R("/subscription_ajax", {
            method: "POST",
            R: this,
            G: b,
            F: a,
            B: function (a, b) {
                Lq(this, n);
                F("UNSUBSCRIBE", this.zb, b, this)
            },
            da: function () {
                this.Nb = p;
                this.enable()
            }
        });
        wf("unsubscribe")
    };
    r.Pf = function (a, b) {
        var c = b.response.id;
        c != this.getId() && this.zb == a && Lq(this, c);
        a == this.zb && Lq(this, c)
    };
    r.Qf = function (a, b) {
        var c = b.response.id;
        c != this.getId() && this.zb == a && Lq(this, c)
    };

    function Pq(a, b, c) {
        this.e = a;
        (a = b || n) || (a = Qq(this.e));
        a = ra("__%s__", "(" + a.join("|") + ")");
        this.g = RegExp(a, "g");
        this.b = c || {}
    }
    var Rq = /__([a-z]+(?:_[a-z]+)*)__/g;

    function Sq() {
        var a = L(L("pyv-afc-ads-template")).innerHTML,
            a = a.replace(/^\s*(\x3c!--\s*)?/, ""),
            a = a.replace(/(\s*--\x3e)?\s*$/, "");
        return new Pq(a, h, h)
    }
    function Qq(a) {
        var b = [],
            c = {};
        a.replace(Rq, function (a, e) {
            e in c || (c[e] = m, b.push(e))
        });
        return b
    }

    function Tq(a, b, c, d) {
        var e = v(function (a, e) {
            c && (e = c(e));
            return d ? b[e] || this.b[e] || "" : va(b[e] || this.b[e] || "")
        }, a);
        return a.e.replace(a.g, e)
    };

    function Uq(a, b, c) {
        var d = new Pq(B("WATCH_CONTEXT_CONTAINER_TEMPLATE")),
            e = new Pq(B("WATCH_CONTEXT_VIDEO_TEMPLATE")),
            f = new Pq(B("WATCH_CONTEXT_PLAYLIST_TEMPLATE")),
            k = new Pq(B("WATCH_CONTEXT_APPBAR_TEMPLATE")),
            l = a.clickindex,
            q = a.type,
            A = [];
        z(a.items, function (a, b) {
            var c, d = b == l;
            switch (a.type) {
                case "playlist":
                    c = Vq(a, f, d, q);
                    break;
                case "video":
                    c = Wq(a, e, d, q)
            }
            c && A.push(c)
        });
        if (A.length) {
            var H = A.length,
                A = A.join(""),
                d = Xq(a, d, A);
            c && (c.innerHTML = Yq(a, k, H));
            b.innerHTML = d;
            S(b, "context-type", q);
            if (a = L("context-image")) b =
                    T(a, "context-image"), a.src = b
        }
    }

    function Xq(a, b, c) {
        var d = {};
        fb(Zq, function (b, c) {
            d[b] = a[c]
        });
        d.container_classes = "context-" + a.type + (a.image ? " context-has-image" : "");
        var e = "";
        Yh.test(a.source) ? e = "rtl" : Xh.test(a.source) && (e = "ltr");
        d.title_dir = e;
        d.item_list = "__item_list__";
        d.feature = "g-context-" + a.type;
        a.subsource ? (d.headline = a.source, d.more_from = a.subsource) : (d.headline = "search" == a.type ? Sb("WATCH_CONTEXT_MORE_RESULTS") : Sb("WATCH_CONTEXT_MORE_FROM"), d.more_from = a.source);
        return Tq(b, d).replace("__item_list__", c)
    }

    function Yq(a, b, c) {
        var d = {};
        fb(Zq, function (b, c) {
            d[b] = a[c]
        });
        d.item_count = c;
        c = "";
        Yh.test(a.source) ? c = "rtl" : Xh.test(a.source) && (c = "ltr");
        d.title_dir = c;
        a.subsource ? (d.headline = a.source, d.more_from = a.subsource) : (d.headline = "search" == a.type ? Sb("WATCH_CONTEXT_MORE_RESULTS") : Sb("WATCH_CONTEXT_MORE_FROM"), d.more_from = a.source);
        return Tq(b, d)
    }

    function Vq(a, b, c, d) {
        var e = {};
        fb($q, function (b, c) {
            e[b] = a[c]
        });
        e.playlist_video_id = a.videos[0];
        "channel" == d && (e.action_username = "");
        e.item_classes = "";
        e.item_classes = a.actionverb ? e.item_classes + " show-action" : e.item_classes + " show-username";
        c && (e.item_classes += " context-playing");
        e.feature = "g-context-" + d;
        return Tq(b, e)
    }

    function Wq(a, b, c, d) {
        var e = {};
        fb(ar, function (b, c) {
            e[b] = a[c]
        });
        "channel" == d && (e.action_username = "");
        e.item_classes = "";
        e.item_classes = a.actionverb ? e.item_classes + " show-action" : "channel" == d ? e.item_classes + " show-viewcount" : e.item_classes + " show-username";
        c && (e.item_classes += " context-playing");
        e.feature = "g-context-" + d;
        return Tq(b, e)
    }
    var Zq = {
        clickindex: "click_index",
        link: "back_link",
        image: "image",
        source: "source",
        subsource: "subsource"
    }, $q = {
            actionuser: "action_username",
            actionuserthumb: "action_user_thumb",
            actionuserurl: "action_user_url",
            actionverb: "action_verb",
            count: "video_count",
            countlabel: "video_count_label",
            id: "playlist_id",
            listthumb: "list_thumb",
            title: "playlist_title",
            user: "user_name",
            videos: n
        }, ar = {
            actionuser: "action_username",
            actionuserthumb: "action_user_thumb",
            actionuserurl: "action_user_url",
            actionverb: "action_verb",
            id: "video_id",
            time: "video_time",
            title: "video_title",
            user: "user_name",
            videothumb: "video_thumb",
            views: "view_count"
        };

    function br(a, b, c) {
        X(a);
        c && X(c);
        D(function () {
            I(a, "context-visible");
            c && I(c, "context-visible")
        }, 0);
        cr();
        b && S(a, "start-open", "true");
        if (B("WATCH_CONTEXT_GEN204")) {
            var d = T(a, "context-type"),
                d = d ? "context-type=" + d : "";
            b ? Df("context-rendered-open", d, h) : Df("context-rendered-closed", d, h)
        }
    }
    function dr(a) {
        var b = M("guide-context-item", L("watch-context-item-list"));
        z(b, function (b, d) {
            d == a ? I(b, "context-playing") : J(b, "context-playing")
        })
    }

    function cr() {
        var a = L("watch-context-item-list"),
            a = Ji(Gi.getInstance(), a);
        z(a, function (a) {
            Oj(a)
        })
    };

    function er(a) {
        a = a || {};
        this.url = a.url || "";
        this.urlV8 = a.url_v8 || "";
        this.urlV9As2 = a.url_v9as2 || "";
        this.args = a.args || mb(fr);
        this.assets = a.assets || {};
        this.attrs = a.attrs || mb(gr);
        this.params = a.params || mb(hr);
        this.minVersion = a.min_version || "8.0.0";
        this.fallback = a.fallback || n;
        this.fallbackMessage = a.fallbackMessage || n;
        this.html5 = !! a.html5;
        this.disable = a.disable || {}
    }
    var fr = {
        enablejsapi: 1
    }, gr = {}, hr = {
            allowscriptaccess: "always",
            allowfullscreen: "true",
            bgcolor: "#000000"
        };

    function ir(a) {
        a instanceof er || (a = new er(a));
        return a
    }
    er.prototype.N = function () {
        var a = new er,
            b;
        for (b in this) {
            var c = this[b];
            "object" == ea(c) ? a[b] = mb(c) : a[b] = c
        }
        return a
    };

    function jr() {
        var a = new df;
        a && cf(a) && (this.b = new ff(a))
    }
    y(jr, Cb);
    jr.prototype.b = n;

    function kr(a) {
        var b = {
            volume: 100,
            muted: p,
            nonNormalized: 100
        };
        if (a.b) {
            var c = {};
            try {
                c = a.b.get("yt-player-volume") || {}
            } catch (d) {
                a.b.remove("yt-player-volume")
            }
            b.volume = isNaN(c.volume) ? 100 : Math.min(Math.max(c.volume, 0), 100);
            b.nonNormalized = isNaN(c.nonNormalized) ? b.volume : c.nonNormalized;
            b.muted = c.muted == h ? p : c.muted
        }
        return b
    }
    jr.prototype.P = function () {
        this.b = n;
        jr.L.P.call(this)
    };

    function lr() {
        this.b = [];
        mr(this)
    }
    da(lr);
    r = lr.prototype;
    r.na = 0;
    r.mb = 0;
    r.bc = 0;
    r.vd = "";
    r.Oa = 0;
    r.load = function (a) {
        3 <= this.Oa ? a(this) : this.b.push(a)
    };
    r.getVersion = function () {
        return [this.na, this.mb, this.bc]
    };

    function nr(a, b, c, d) {
        b = "string" == typeof b ? b.split(".") : [b, c, d];
        b[0] = parseInt(b[0], 10) || 0;
        b[1] = parseInt(b[1], 10) || 0;
        b[2] = parseInt(b[2], 10) || 0;
        return a.na > b[0] || a.na == b[0] && a.mb > b[1] || a.na == b[0] && a.mb == b[1] && a.bc >= b[2]
    }

    function or(a) {
        return -1 < a.vd.indexOf("Gnash") && -1 == a.vd.indexOf("AVM2") || 9 == a.na && 1 == a.mb || 9 == a.na && 0 == a.mb && 1 == a.bc ? p : 9 <= a.na
    }
    function pr(a) {
        return -1 < navigator.userAgent.indexOf("Sony/COM2") && !nr(a, 9, 1, 58) ? p : m
    }

    function mr(a) {
        if (3 > a.Oa) if (1 > a.Oa) {
                var b = t("window.navigator.plugins"),
                    c = t("window.navigator.mimeTypes"),
                    b = b && b["Shockwave Flash"],
                    c = c && c["application/x-shockwave-flash"],
                    c = b && c && c.enabledPlugin && b.description || "";
                if (b = c) {
                    var d = b.indexOf("Shockwave Flash");
                    0 <= d && (b = b.substr(d + 15));
                    for (var d = b.split(" "), e = "", b = "", f = 0, k = d.length; f < k; f++) if (e) if (b) break;
                            else b = d[f];
                            else e = d[f];
                    e = e.split(".");
                    d = parseInt(e[0], 10) || 0;
                    e = parseInt(e[1], 10) || 0;
                    f = 0;
                    if ("r" == b.charAt(0) || "d" == b.charAt(0)) f = parseInt(b.substr(1),
                            10) || 0;
                    b = [d, e, f]
                } else b = [0, 0, 0];
                a.vd = c;
                c = b;
                a.na = c[0];
                a.mb = c[1];
                a.bc = c[2];
                a.Oa = 1;
                0 < a.na ? qr(a) : mr(a)
            } else 2 > a.Oa ? rr(a) : qr(a)
    }
    r.$e = function (a) {
        a ? (a = a.split(" ")[1].split(","), a = [parseInt(a[0], 10) || 0, parseInt(a[1], 10) || 0, parseInt(a[2], 10) || 0]) : a = [0, 0, 0];
        this.na = a[0];
        this.mb = a[1];
        this.bc = a[2];
        this.Oa = 2;
        0 < this.na ? qr(this) : mr(this)
    };

    function qr(a) {
        if (3 > a.Oa) {
            a.Oa = 3;
            for (var b = 0, c = a.b.length; b < c; b++) a.b[b](a);
            a.b = []
        }
    }

    function rr(a) {
        function b() {
            if (c && "GetVariable" in c) try {
                    d = c.GetVariable("$version")
            } catch (a) {
                d = ""
            }
            d || 10 <= q ? (e && f && e.removeChild(f), l(d || "")) : (q++, D(b, 10))
        }
        var c, d, e, f;
        if (Ub) {
            try {
                c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
            } catch (k) {
                c = n
            }
            c || a.$e("")
        } else e = document.getElementsByTagName("body")[0], f = document.createElement("object"), f.setAttribute("type", "application/x-shockwave-flash"), c = e.appendChild(f);
        var l = v(a.$e, a),
            q = 0;
        D(b, 0)
    };

    function sr(a, b, c) {
        if ((a = L(a)) && b && c) {
            c = ir(c);
            var d = mb(c.attrs);
            d.tabindex = 0;
            var e = mb(c.params);
            e.flashvars = He(c.args);
            if (Ub) {
                d.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
                e.movie = b;
                b = document.createElement("object");
                for (var f in d) b.setAttribute(f, d[f]);
                for (f in e) d = document.createElement("param"), d.setAttribute("name", f), d.setAttribute("value", e[f]), b.appendChild(d)
            } else {
                d.type = "application/x-shockwave-flash";
                d.src = b;
                b = document.createElement("embed");
                for (f in d) b.setAttribute(f, d[f]);
                for (f in e) b.setAttribute(f,
                        e[f])
            }
            e = document.createElement("div");
            e.appendChild(b);
            a.innerHTML = e.innerHTML
        }
    }
    function tr(a, b) {
        a = L(a);
        b = ir(b);
        if (window != window.top) {
            var c = n;
            document.referrer && (c = document.referrer.substring(0, 128));
            b.args.framer = c
        }
        ur(function (c) {
            nr(c, b.minVersion) || B("IS_OPERA_MINI") ? (c = or(c) && b.url || pr(c) && b.urlV9As2 || b.urlV8 || b.url, sr(a, c, b)) : vr(a, b, c)
        })
    }

    function wr(a, b, c) {
        if (a) {
            a = ir(a);
            var d = !! b,
                e = L(a.attrs.id),
                f = e ? e.parentNode : n;
            if (!e || !f) D(function () {
                    wr(a, b, c)
                }, 50);
            else {
                if (window != window.top) {
                    var k = n;
                    if (document.referrer) {
                        var l = document.referrer.substring(0, 128);
                        Me(l) || (k = l)
                    } else k = "unknown";
                    k && (d = m, a.args.framer = k)
                }
                ur(function (b) {
                    if (nr(b, a.minVersion) || B("IS_OPERA_MINI")) {
                        var k = or(b) && a.url || pr(b) && a.urlV9As2 || a.urlV8 || a.url,
                            l = ""; - 1 < navigator.userAgent.indexOf("Sony/COM2") || (l = e.getAttribute("src") || e.movie);
                        (l != k || d) && sr(f, k, a);
                        if (ec ? !nr(b, 11,
                            2) : dc ? !nr(b, 11, 3) : !or(b)) b = L("flash10-promo-div"), k = pj(kj.getInstance(), sj.gi), b && !k && X(b)
                    } else vr(f, a, b);
                    c && c()
                })
            }
        }
    }
    function vr(a, b, c) {
        0 == c.na && b.fallback ? b.fallback() : 0 == c.na && b.fallbackMessage ? b.fallbackMessage() : a.innerHTML = '<div id="flash-upgrade">' + Sb("FLASH_UPGRADE", h, 'You need to upgrade your Adobe Flash Player to watchthis video. <br> <a href="http://get.adobe.com/flashplayer/">Download it from Adobe.</a>') + "</div>"
    }

    function ur(a) {
        lr.getInstance().load(function (b) {
            kj.getInstance().set("fv", b.getVersion().join("."));
            rj();
            a(b)
        })
    };
    var xr, yr, zr, Ar, Br, Cr, Dr;
    Dr = Cr = Br = Ar = zr = yr = xr = p;
    var Er = fc();
    Er && (-1 != Er.indexOf("Firefox") ? xr = m : -1 != Er.indexOf("Camino") ? yr = m : -1 != Er.indexOf("iPhone") || -1 != Er.indexOf("iPod") ? zr = m : -1 != Er.indexOf("iPad") ? Ar = m : -1 != Er.indexOf("Android") ? Br = m : -1 != Er.indexOf("Chrome") ? Cr = m : -1 != Er.indexOf("Safari") && (Dr = m));
    var Fr = xr,
        Gr = yr,
        Hr = zr,
        Ir = Ar,
        Jr = Br,
        Kr = Cr,
        Lr = Dr;

    function Mr() {
        var a = fc();
        if (!a ? 0 : 0 <= a.toLowerCase().indexOf("android 2.2")) return m;
        a = t("yt.player.utils.videoElement_");
        a || (a = document.createElement("video"), x("yt.player.utils.videoElement_", a));
        try {
            return !(!a || !a.canPlayType || !a.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"') && !a.canPlayType('video/webm; codecs="vp8.0, vorbis"'))
        } catch (b) {
            return p
        }
    };
    var Nr;

    function Or(a) {
        a && (this.id = a.id || "", this.name = a.name || "", this.status = a.status || "UNKNOWN")
    }
    Or.prototype.id = "";
    Or.prototype.name = "";
    Or.prototype.status = "UNKNOWN";

    function Pr() {
        !Nr && "cast" in window && (Nr = new cast.Api, Nr.addReceiverListener("YouTube", Qr))
    }
    function Qr(a) {
        Ua(Rr);
        z(a, function (a) {
            Rr.push(new Or(a))
        });
        F("yt-remote-dial-device-list-update", Rr)
    }

    function Sr(a, b) {
        "running" == b.status && b.activityId ? (a.status = "RUNNING", Tr[a.id] = b.activityId) : (a.status = "error" == b.status ? "ERROR" : "UNKNOWN", delete Tr[a.id]);
        F("yt-remote-dial-device-status-update", a)
    }
    function Ur(a, b) {
        "stopped" == b.status ? (a.status = "STOPPED", delete Tr[a.id]) : a.status = "error" == b.status ? "ERROR" : "UNKNOWN";
        F("yt-remote-dial-device-status-update", a)
    }
    function Vr(a) {
        return Qa(Rr, function (b) {
            return b.id == a
        }) || n
    }
    var Rr = t("yt.remote.dialapi.devices_") || [];
    x("yt.remote.dialapi.devices_", Rr);
    var Tr = t("yt.remote.dialapi.activities_") || {};
    x("yt.remote.dialapi.activities_", Tr);

    function Wr(a) {
        a && (this.name = a.name, this.za = a.screenId, this.wa = a.loungeToken, this.b = a.dialId || "")
    }
    Wr.prototype.name = "";
    Wr.prototype.za = "";
    Wr.prototype.wa = "";
    Wr.prototype.b = "";

    function Xr(a) {
        return {
            name: a.name,
            screenId: a.za,
            loungeToken: a.wa,
            dialId: a.b
        }
    };

    function Yr() {
        return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (a) {
            var b = 16 * Math.random() | 0;
            return ("x" == a ? b : b & 3 | 8).toString(16)
        })
    }
    function Zr(a, b) {
        return Qa(a, function (a) {
            return a.key == b
        })
    }
    function $r(a) {
        return Na(a, function (a) {
            return {
                id: a.id,
                name: a.name,
                status: a.status
            }
        })
    }
    function as() {
        var a = bs();
        return Na(a, function (a) {
            return new Or(a)
        })
    }
    function cs(a, b) {
        return !a && !b ? m : !a || !b ? p : a.id == b.id && a.name == b.name
    }
    function ds(a, b) {
        return Qa(a, function (a) {
            return a.id == b
        })
    }

    function es(a) {
        return Na(a, function (a) {
            return {
                key: a.za,
                name: a.name
            }
        })
    }
    function fs(a) {
        return Na(a, function (a) {
            return Xr(a)
        })
    }
    function gs(a) {
        return Na(a, function (a) {
            return new Wr(a)
        })
    }
    function hs(a, b) {
        return !a && !b ? m : !a || !b ? p : a.za == b.za
    }
    function is(a, b) {
        return !a && !b ? m : !a || !b ? p : a.za == b.za && a.wa == b.wa && a.name == b.name && a.b == b.b
    }
    function js(a, b) {
        return Qa(a, function (a) {
            return hs(a, b)
        })
    }
    function ks(a, b) {
        return Qa(a, function (a) {
            return b == a.za || b == a.b
        })
    };

    function ls() {
        var a = Pi("remote_sid") || rf("yt-remote-session-id");
        a || (a = Yr(), pf("yt-remote-session-id", a));
        return a
    }
    function ms(a) {
        return a + "-" + ls()
    }
    function ns(a) {
        Oi("remote_sid", ls());
        pf(ms("yt-remote-session-screen"), a, 600)
    }
    function os() {
        var a = ms("yt-remote-session-screen");
        qf && qf.remove(a);
        of && of.remove(a);
        Qi("remote_sid")
    }
    function ps(a) {
        pf(ms("yt-remote-session-player-context"), a, 30)
    }
    function qs() {
        var a = ms("yt-remote-session-player-context");
        qf && qf.remove(a);
        of && of.remove(a)
    }

    function rs() {
        return rf("yt-remote-app-screens") || []
    }
    function ss() {
        return rf("yt-remote-online-screens") || []
    }
    function ts(a) {
        pf("yt-remote-online-dial-devices", a, 30)
    }
    function bs() {
        return rf("yt-remote-online-dial-devices") || []
    };

    function us() {
        var a = gs(ss()),
            b = as(),
            b = Ma(b, function (b) {
                return !ks(a, b.id)
            });
        return es(Wa(a, b))
    };

    function vs() {
        this.A = new Fb;
        Db(this, qa(Eb, this.A))
    }
    y(vs, Cb);
    vs.prototype.aa = function (a, b, c) {
        this.o || this.A.aa(a, b, c)
    };
    vs.prototype.va = function (a, b, c) {
        this.o || this.A.va(a, b, c)
    };
    vs.prototype.M = function (a, b) {
        this.o || this.A.M.apply(this.A, arguments)
    };

    function ws(a, b) {
        this.e = new Td(a);
        this.b = b ? Qd : Pd
    }
    ws.prototype.stringify = function (a) {
        return Sd(this.e, a)
    };
    ws.prototype.parse = function (a) {
        return this.b(a)
    };

    function xs(a, b, c) {
        this.i = a;
        this.g = b;
        this.e = c;
        this.b = v(this.Df, this)
    }
    y(xs, Cb);
    r = xs.prototype;
    r.Gc = p;
    r.Ab = n;
    r.stop = function () {
        this.Ab && (In.clearTimeout(this.Ab), this.Ab = n, this.Gc = p)
    };
    r.P = function () {
        xs.L.P.call(this);
        this.stop()
    };
    r.Df = function () {
        this.Ab = n;
        this.Gc && (this.Gc = p, ys(this))
    };

    function ys(a) {
        a.Ab = Kn(a.b, a.g);
        a.i.call(a.e)
    };

    function zs() {}
    zs.prototype.b = n;
    var As;

    function Bs() {}
    y(Bs, zs);

    function Cs(a) {
        return (a = Ds(a)) ? new ActiveXObject(a) : new XMLHttpRequest
    }
    function Es(a) {
        var b = {};
        Ds(a) && (b[0] = m, b[1] = m);
        return b
    }

    function Ds(a) {
        if (!a.e && "undefined" == typeof XMLHttpRequest && "undefined" != typeof ActiveXObject) {
            for (var b = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], c = 0; c < b.length; c++) {
                var d = b[c];
                try {
                    return new ActiveXObject(d), a.e = d
                } catch (e) {}
            }
            g(Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed"))
        }
        return a.e
    }
    As = new Bs;

    function Fs(a, b, c, d, e) {
        this.e = a;
        this.b = b;
        this.o = c;
        this.g = d;
        this.i = e || 1;
        this.C = 45E3;
        this.A = new Bn(this);
        this.j = new Hn;
        Jn(this.j, 250)
    }
    r = Fs.prototype;
    r.Ta = n;
    r.ra = p;
    r.Cb = n;
    r.nd = n;
    r.Gb = n;
    r.xb = n;
    r.Ga = n;
    r.ia = n;
    r.tb = n;
    r.W = n;
    r.Jb = 0;
    r.ta = n;
    r.rb = n;
    r.Ia = n;
    r.Fb = -1;
    r.Ld = m;
    r.Ya = p;
    r.Tc = 0;
    r.ec = n;

    function Gs(a, b) {
        switch (a) {
            case 0:
                return "Non-200 return code (" + b + ")";
            case 1:
                return "XMLHTTP failure (no data)";
            case 2:
                return "HttpConnection timeout";
            default:
                return "Unknown error"
        }
    }
    var Hs = {}, Is = {};
    r = Fs.prototype;
    r.setTimeout = function (a) {
        this.C = a
    };

    function Js(a, b, c) {
        a.xb = 1;
        a.Ga = hl(b.N());
        a.tb = c;
        a.K = m;
        Ks(a, n)
    }
    function Ls(a, b, c, d, e) {
        a.xb = 1;
        a.Ga = hl(b.N());
        a.tb = n;
        a.K = c;
        e && (a.Ld = p);
        Ks(a, d)
    }

    function Ks(a, b) {
        a.Gb = w();
        Ms(a);
        a.ia = a.Ga.N();
        fl(a.ia, "t", a.i);
        a.Jb = 0;
        a.W = a.e.Vc(a.e.jc() ? b : n);
        0 < a.Tc && (a.ec = new xs(v(a.Nd, a, a.W), a.Tc));
        Dn(a.A, a.W, "readystatechange", a.yf);
        var c = a.Ta ? mb(a.Ta) : {};
        a.tb ? (a.rb = "POST", c["Content-Type"] = "application/x-www-form-urlencoded", Ns(a.W, a.ia, a.rb, a.tb, c)) : (a.rb = "GET", a.Ld && !lc && (c.Connection = "close"), Ns(a.W, a.ia, a.rb, n, c));
        a.e.qa(1);
        var d = a.tb;
        if (d) for (var c = "", d = d.split("&"), e = 0; e < d.length; e++) {
                var f = d[e].split("=");
                if (1 < f.length) var k = f[0],
                f = f[1], l = k.split("_"),
                c = 2 <= l.length && "type" == l[1] ? c + (k + "=" + f + "&") : c + (k + "=redacted&")
        } else c = n;
        a.b.info("XMLHTTP REQ (" + a.g + ") [attempt " + a.i + "]: " + a.rb + "\n" + a.ia + "\n" + c)
    }
    r.yf = function (a) {
        a = a.target;
        var b = this.ec;
        b && 3 == Os(a) ? (this.b.info("Throttling readystatechange."), !b.Ab ? ys(b) : b.Gc = m) : this.Nd(a)
    };
    r.Nd = function (a) {
        try {
            if (a == this.W) a: {
                    var b = Os(this.W),
                        c = this.W.Hb,
                        d = Ps(this.W);
                    if (G && !zc(10) || lc && !yc("420+")) {
                        if (4 > b) break a
                    } else if (3 > b || 3 == b && !jc && !Qs(this.W)) break a;
                    !this.Ya && (4 == b && 7 != c) && (8 == c || 0 >= d ? this.e.qa(3) : this.e.qa(2));
                    Rs(this);
                    var e = Ps(this.W);
                    this.Fb = e;
                    var f = Qs(this.W);
                    f || this.b.info("No response text for uri " + this.ia + " status " + e);
                    this.ra = 200 == e;
                    this.b.info("XMLHTTP RESP (" + this.g + ") [ attempt " + this.i + "]: " + this.rb + "\n" + this.ia + "\n" + b + " " + e);
                    this.ra ? (4 == b && Ss(this), this.K ? (Ts(this,
                        b, f), jc && 3 == b && (Dn(this.A, this.j, "tick", this.xf), this.j.start())) : (Us(this.b, this.g, f, n), Vs(this, f)), this.ra && !this.Ya && (4 == b ? this.e.gc(this) : (this.ra = p, Ms(this)))) : (400 == e && 0 < f.indexOf("Unknown SID") ? (this.Ia = 3, Ws(), Xs(this.b, "XMLHTTP Unknown SID (" + this.g + ")")) : (this.Ia = 0, Ws(), Xs(this.b, "XMLHTTP Bad status " + e + " (" + this.g + ")")), Ss(this), Ys(this))
            } else Xs(this.b, "Called back with an unexpected xmlhttp")
        } catch (k) {
            this.b.info("Failed call to OnXmlHttpReadyStateChanged_"), this.W && Qs(this.W) ? Zs(this.b,
                k, "ResponseText: " + Qs(this.W)) : Zs(this.b, k, "No response text")
        } finally {}
    };

    function Ts(a, b, c) {
        for (var d = m; !a.Ya && a.Jb < c.length;) {
            var e = $s(a, c);
            if (e == Is) {
                4 == b && (a.Ia = 4, Ws(), d = p);
                Us(a.b, a.g, n, "[Incomplete Response]");
                break
            } else if (e == Hs) {
                a.Ia = 4;
                Ws();
                Us(a.b, a.g, c, "[Invalid Chunk]");
                d = p;
                break
            } else Us(a.b, a.g, e, n), Vs(a, e)
        }
        4 == b && 0 == c.length && (a.Ia = 1, Ws(), d = p);
        a.ra = a.ra && d;
        d || (Us(a.b, a.g, c, "[Invalid Chunked Response]"), Ss(a), Ys(a))
    }
    r.xf = function () {
        var a = Os(this.W),
            b = Qs(this.W);
        this.Jb < b.length && (Rs(this), Ts(this, a, b), this.ra && 4 != a && Ms(this))
    };

    function $s(a, b) {
        var c = a.Jb,
            d = b.indexOf("\n", c);
        if (-1 == d) return Is;
        c = Number(b.substring(c, d));
        if (isNaN(c)) return Hs;
        d += 1;
        if (d + c > b.length) return Is;
        var e = b.substr(d, c);
        a.Jb = d + c;
        return e
    }

    function at(a, b) {
        a.Gb = w();
        Ms(a);
        var c = b ? window.location.hostname : "";
        a.ia = a.Ga.N();
        el(a.ia, "DOMAIN", c);
        el(a.ia, "t", a.i);
        try {
            a.ta = new ActiveXObject("htmlfile")
        } catch (d) {
            bt(a.b, "ActiveX blocked");
            Ss(a);
            a.Ia = 7;
            Ws();
            Ys(a);
            return
        }
        var e = "<html><body>";
        b && (e += '<script>document.domain="' + c + '"\x3c/script>');
        e += "</body></html>";
        a.ta.open();
        a.ta.write(e);
        a.ta.close();
        a.ta.parentWindow.m = v(a.zf, a);
        a.ta.parentWindow.d = v(a.Pd, a, m);
        a.ta.parentWindow.rpcClose = v(a.Pd, a, p);
        c = a.ta.createElement("div");
        a.ta.parentWindow.document.body.appendChild(c);
        c.innerHTML = '<iframe src="' + a.ia + '"></iframe>';
        a.b.info("TRIDENT REQ (" + a.g + ") [ attempt " + a.i + "]: GET\n" + a.ia);
        a.e.qa(1)
    }
    r.zf = function (a) {
        ct(v(this.li, this, a), 0)
    };
    r.li = function (a) {
        if (!this.Ya) {
            var b = this.b;
            b.info("TRIDENT TEXT (" + this.g + "): " + dt(b, a));
            Rs(this);
            Vs(this, a);
            Ms(this)
        }
    };
    r.Pd = function (a) {
        ct(v(this.ki, this, a), 0)
    };
    r.ki = function (a) {
        this.Ya || (this.b.info("TRIDENT TEXT (" + this.g + "): " + a ? "success" : "failure"), Ss(this), this.ra = a, this.e.gc(this), this.e.qa(4))
    };

    function et(a) {
        a.Ya = m;
        Ss(a)
    }

    function Ms(a) {
        a.nd = w() + a.C;
        ft(a, a.C)
    }
    function ft(a, b) {
        a.Cb != n && g(Error("WatchDog timer not null"));
        a.Cb = ct(v(a.Nh, a), b)
    }
    function Rs(a) {
        a.Cb && (s.clearTimeout(a.Cb), a.Cb = n)
    }
    r.Nh = function () {
        this.Cb = n;
        var a = w();
        0 <= a - this.nd ? (this.ra && bt(this.b, "Received watchdog timeout even though request loaded successfully"), this.b.info("TIMEOUT: " + this.ia), 2 != this.xb && this.e.qa(3), Ss(this), this.Ia = 2, Ws(), Ys(this)) : (Xs(this.b, "WatchDog timer called too early"), ft(this, this.nd - a))
    };

    function Ys(a) {
        !a.e.ve() && !a.Ya && a.e.gc(a)
    }
    function Ss(a) {
        Rs(a);
        Eb(a.ec);
        a.ec = n;
        a.j.stop();
        a.A.removeAll();
        if (a.W) {
            var b = a.W;
            a.W = n;
            b.S && b.La && (me(b.b, gt(b, "Aborting")), b.La = p, b.eb = m, b.S.abort(), b.eb = p, b.Hb = 7, Gn(b, "complete"), Gn(b, "abort"), ht(b));
            b.ma()
        }
        a.ta && (a.ta = n)
    }
    function Vs(a, b) {
        try {
            a.e.je(a, b), a.e.qa(4)
        } catch (c) {
            Zs(a.b, c, "Error in httprequest callback")
        }
    };

    function it() {
        this.b = pe("goog.net.BrowserChannel")
    }
    function Us(a, b, c, d) {
        a.info("XMLHTTP TEXT (" + b + "): " + dt(a, c) + (d ? " " + d : ""))
    }
    function jt(a, b) {
        a.info(b)
    }
    function Zs(a, b, c) {
        bt(a, (c || "Exception") + b)
    }
    it.prototype.info = function (a) {
        this.b.info(a)
    };

    function Xs(a, b) {
        a.b.log(he, b, h)
    }
    function bt(a, b) {
        a.b.log(ge, b, h)
    }

    function dt(a, b) {
        if (!b || "y2f%" == b) return b;
        try {
            var c = Qd(b);
            if (c) for (var d = 0; d < c.length; d++) if (ga(c[d])) {
                        var e = c[d];
                        if (!(2 > e.length)) {
                            var f = e[1];
                            if (ga(f) && !(1 > f.length)) {
                                var k = f[0];
                                if ("noop" != k && "stop" != k) for (var l = 1; l < f.length; l++) f[l] = ""
                            }
                        }
                    }
            return Rd(c)
        } catch (q) {
            return a.info("Exception parsing expected JS array - probably was not JS"), b
        }
    };

    function kt(a, b, c, d, e) {
        jt(new it, "TestLoadImageWithRetries: " + e);
        if (0 == d) c(p);
        else {
            var f = e || 0;
            d--;
            lt(a, b, function (e) {
                e ? c(m) : s.setTimeout(function () {
                    kt(a, b, c, d, f)
                }, f)
            })
        }
    }

    function lt(a, b, c) {
        var d = new it;
        d.info("TestLoadImage: loading " + a);
        var e = new Image;
        e.onload = function () {
            try {
                d.info("TestLoadImage: loaded"), mt(e), c(m)
            } catch (a) {
                Zs(d, a)
            }
        };
        e.onerror = function () {
            try {
                d.info("TestLoadImage: error"), mt(e), c(p)
            } catch (a) {
                Zs(d, a)
            }
        };
        e.onabort = function () {
            try {
                d.info("TestLoadImage: abort"), mt(e), c(p)
            } catch (a) {
                Zs(d, a)
            }
        };
        e.ontimeout = function () {
            try {
                d.info("TestLoadImage: timeout"), mt(e), c(p)
            } catch (a) {
                Zs(d, a)
            }
        };
        s.setTimeout(function () {
            if (e.ontimeout) e.ontimeout()
        }, b);
        e.src = a
    }

    function mt(a) {
        a.onload = n;
        a.onerror = n;
        a.onabort = n;
        a.ontimeout = n
    };

    function nt(a, b) {
        this.b = a;
        this.e = b;
        this.g = new ws(n, m)
    }
    r = nt.prototype;
    r.Yc = n;
    r.ja = n;
    r.qc = p;
    r.Sd = n;
    r.oc = n;
    r.dd = n;
    r.fd = n;
    r.ka = n;
    r.Za = -1;
    r.Mb = n;
    r.Ob = n;
    r.connect = function (a) {
        this.fd = a;
        a = ot(this.b, this.fd);
        Ws();
        this.Sd = w();
        var b = this.b.K;
        b != n ? (this.Mb = b[0], (this.Ob = b[1]) ? (this.ka = 1, pt(this)) : (this.ka = 2, qt(this))) : (fl(a, "MODE", "init"), this.ja = new Fs(this, this.e, h, h, h), this.ja.Ta = this.Yc, Ls(this.ja, a, p, n, m), this.ka = 0)
    };

    function pt(a) {
        var b = rt(a.b, a.Ob, "/mail/images/cleardot.gif");
        hl(b);
        kt(b.toString(), 5E3, v(a.Lg, a), 3, 2E3);
        a.qa(1)
    }
    r.Lg = function (a) {
        if (a) this.ka = 2, qt(this);
        else {
            Ws();
            var b = this.b;
            b.b.info("Test Connection Blocked");
            b.Ca = b.Na.Za;
            st(b, 9)
        }
        a && this.qa(2)
    };

    function qt(a) {
        a.e.info("TestConnection: starting stage 2");
        var b = a.b.U;
        if (b != n) a.e.info("TestConnection: skipping stage 2, precomputed result is " + b ? "Buffered" : "Unbuffered"), Ws(), b ? (Ws(), tt(a.b, a, p)) : (Ws(), tt(a.b, a, m));
        else if (a.ja = new Fs(a, a.e, h, h, h), a.ja.Ta = a.Yc, b = ut(a.b, a.Mb, a.fd), Ws(), !G || zc(10)) fl(b, "TYPE", "xmlhttp"), Ls(a.ja, b, p, a.Mb, p);
        else {
            fl(b, "TYPE", "html");
            var c = a.ja;
            a = Boolean(a.Mb);
            c.xb = 3;
            c.Ga = hl(b.N());
            at(c, a)
        }
    }
    r.Vc = function (a) {
        return this.b.Vc(a)
    };
    r.ve = function () {
        return p
    };
    r.je = function (a, b) {
        this.Za = a.Fb;
        if (0 == this.ka) if (this.e.info("TestConnection: Got data for stage 1"), b) {
                try {
                    var c = this.g.parse(b)
                } catch (d) {
                    Zs(this.e, d);
                    vt(this.b, this);
                    return
                }
                this.Mb = c[0];
                this.Ob = c[1]
            } else this.e.info("TestConnection: Null responseText"), vt(this.b, this);
            else if (2 == this.ka) if (this.qc) Ws(), this.dd = w();
            else if ("11111" == b) {
            if (Ws(), this.qc = m, this.oc = w(), c = this.oc - this.Sd, !G || zc(10) || 500 > c) this.Za = 200, et(this.ja), this.e.info("Test connection succeeded; using streaming connection"), Ws(),
            tt(this.b, this, m)
        } else Ws(), this.oc = this.dd = w(), this.qc = p
    };
    r.gc = function () {
        this.Za = this.ja.Fb;
        if (this.ja.ra) if (0 == this.ka) this.e.info("TestConnection: request complete for initial check"), this.Ob ? (this.ka = 1, pt(this)) : (this.ka = 2, qt(this));
            else {
                if (2 == this.ka) {
                    this.e.info("TestConnection: request complete for stage 2");
                    var a = p;
                    (a = !G || zc(10) ? this.qc : 200 > this.dd - this.oc ? p : m) ? (this.e.info("Test connection succeeded; using streaming connection"), Ws(), tt(this.b, this, m)) : (this.e.info("Test connection failed; not using streaming"), Ws(), tt(this.b, this, p))
                }
            } else this.e.info("TestConnection: request failed, in state " +
                    this.ka), 0 == this.ka ? Ws() : 2 == this.ka && Ws(), vt(this.b, this)
    };
    r.jc = function () {
        return this.b.jc()
    };
    r.qa = function (a) {
        this.b.qa(a)
    };

    function wt(a) {
        this.headers = new Hd;
        this.e = a || n
    }
    y(wt, Fn);
    wt.prototype.b = pe("goog.net.XhrIo");
    var xt = /^https?$/i;
    r = wt.prototype;
    r.La = p;
    r.S = n;
    r.uc = n;
    r.vc = "";
    r.ae = "";
    r.Hb = 0;
    r.kd = "";
    r.md = p;
    r.tc = p;
    r.ld = p;
    r.eb = p;
    r.Bb = n;
    r.be = "";
    r.ce = p;

    function Ns(a, b, c, d, e) {
        a.S && g(Error("[goog.net.XhrIo] Object is active with another request=" + a.vc + "; newUri=" + b));
        c = c ? c.toUpperCase() : "GET";
        a.vc = b;
        a.kd = "";
        a.Hb = 0;
        a.ae = c;
        a.md = p;
        a.La = m;
        a.S = a.e ? Cs(a.e) : Cs(As);
        a.uc = a.e ? a.e.b || (a.e.b = Es(a.e)) : As.b || (As.b = Es(As));
        a.S.onreadystatechange = v(a.$d, a);
        try {
            me(a.b, gt(a, "Opening Xhr")), a.ld = m, a.S.open(c, b, m), a.ld = p
        } catch (f) {
            me(a.b, gt(a, "Error opening Xhr: " + f.message));
            zt(a, f);
            return
        }
        b = d || "";
        var k = a.headers.N();
        e && Gd(e, function (a, b) {
            k.set(b, a)
        });
        e = Qa(k.Ma(), At);
        d = s.FormData && b instanceof s.FormData;
        "POST" == c && (!e && !d) && k.set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
        Gd(k, function (a, b) {
            this.S.setRequestHeader(b, a)
        }, a);
        a.be && (a.S.responseType = a.be);
        "withCredentials" in a.S && (a.S.withCredentials = a.ce);
        try {
            a.Bb && (In.clearTimeout(a.Bb), a.Bb = n), me(a.b, gt(a, "Sending request")), a.tc = m, a.S.send(b), a.tc = p
        } catch (l) {
            me(a.b, gt(a, "Send error: " + l.message)), zt(a, l)
        }
    }
    function At(a) {
        return "content-type" == a.toLowerCase()
    }

    function zt(a, b) {
        a.La = p;
        a.S && (a.eb = m, a.S.abort(), a.eb = p);
        a.kd = b;
        a.Hb = 5;
        Bt(a);
        ht(a)
    }
    function Bt(a) {
        a.md || (a.md = m, Gn(a, "complete"), Gn(a, "error"))
    }
    r.P = function () {
        this.S && (this.La && (this.La = p, this.eb = m, this.S.abort(), this.eb = p), ht(this, m));
        wt.L.P.call(this)
    };
    r.$d = function () {
        !this.ld && !this.tc && !this.eb ? this.Bh() : Ct(this)
    };
    r.Bh = function () {
        Ct(this)
    };

    function Ct(a) {
        if (a.La && "undefined" != typeof aa) if (a.uc[1] && 4 == Os(a) && 2 == Ps(a)) me(a.b, gt(a, "Local request error detected and ignored"));
            else if (a.tc && 4 == Os(a)) In.setTimeout(v(a.$d, a), 0);
        else if (Gn(a, "readystatechange"), 4 == Os(a)) {
            me(a.b, gt(a, "Request complete"));
            a.La = p;
            try {
                var b = Ps(a),
                    c, d;
                a: switch (b) {
                    case 200:
                    case 201:
                    case 202:
                    case 204:
                    case 206:
                    case 304:
                    case 1223:
                        d = m;
                        break a;
                    default:
                        d = p
                }
                if (!(c = d)) {
                    var e;
                    if (e = 0 === b) {
                        var f = se(String(a.vc))[1] || n;
                        if (!f && self.location) var k = self.location.protocol,
                        f = k.substr(0,
                            k.length - 1);
                        e = !xt.test(f ? f.toLowerCase() : "")
                    }
                    c = e
                }
                if (c) Gn(a, "complete"), Gn(a, "success");
                else {
                    a.Hb = 6;
                    var l;
                    try {
                        l = 2 < Os(a) ? a.S.statusText : ""
                    } catch (q) {
                        me(a.b, "Can not get status: " + q.message), l = ""
                    }
                    a.kd = l + " [" + Ps(a) + "]";
                    Bt(a)
                }
            } finally {
                ht(a)
            }
        }
    }
    function ht(a, b) {
        if (a.S) {
            var c = a.S,
                d = a.uc[0] ? ca : n;
            a.S = n;
            a.uc = n;
            a.Bb && (In.clearTimeout(a.Bb), a.Bb = n);
            b || Gn(a, "ready");
            try {
                c.onreadystatechange = d
            } catch (e) {
                a.b.log(ge, "Problem encountered resetting onreadystatechange: " + e.message, h)
            }
        }
    }

    function Os(a) {
        return a.S ? a.S.readyState : 0
    }
    function Ps(a) {
        try {
            return 2 < Os(a) ? a.S.status : -1
        } catch (b) {
            return a.b.log(he, "Can not get status: " + b.message, h), -1
        }
    }
    function Qs(a) {
        try {
            return a.S ? a.S.responseText : ""
        } catch (b) {
            return me(a.b, "Can not get responseText: " + b.message), ""
        }
    }
    function gt(a, b) {
        return b + " [" + a.ae + " " + a.vc + " " + Ps(a) + "]"
    };

    function Dt(a, b, c) {
        this.C = a || n;
        this.e = 1;
        this.g = [];
        this.i = [];
        this.b = new it;
        this.j = new ws(n, m);
        this.K = b || n;
        this.U = c != n ? c : n
    }
    function Et(a, b) {
        this.b = a;
        this.map = b;
        this.R = n
    }
    r = Dt.prototype;
    r.Tb = n;
    r.ea = n;
    r.V = n;
    r.Uc = n;
    r.hc = n;
    r.Od = n;
    r.lc = n;
    r.Ib = 0;
    r.Nf = 0;
    r.ca = n;
    r.Ka = n;
    r.Da = n;
    r.$a = n;
    r.Na = n;
    r.kc = n;
    r.qb = -1;
    r.Vd = -1;
    r.Ca = -1;
    r.Kb = 0;
    r.yb = 0;
    r.Wa = 8;
    var Ft = new Fn;

    function Gt(a) {
        am.call(this, "statevent", a)
    }
    y(Gt, am);

    function Ht(a) {
        am.call(this, "timingevent", a)
    }
    y(Ht, am);

    function It(a) {
        am.call(this, "serverreachability", a)
    }
    y(It, am);
    r = Dt.prototype;
    r.connect = function (a, b, c, d, e) {
        this.b.info("connect()");
        Ws();
        this.Uc = b;
        this.Tb = c || {};
        d && fa(e) && (this.Tb.OSID = d, this.Tb.OAID = e);
        this.b.info("connectTest_()");
        this.Na = new nt(this, this.b);
        this.Na.Yc = n;
        this.Na.g = this.j;
        this.Na.connect(a)
    };

    function Jt(a) {
        if (a.Na) {
            var b = a.Na;
            b.ja && (et(b.ja), b.ja = n);
            b.Za = -1;
            a.Na = n
        }
        a.V && (et(a.V), a.V = n);
        a.Da && (s.clearTimeout(a.Da), a.Da = n);
        Kt(a);
        a.ea && (et(a.ea), a.ea = n);
        a.Ka && (s.clearTimeout(a.Ka), a.Ka = n)
    }
    r.ve = function () {
        return 0 == this.e
    };

    function Lt(a) {
        !a.ea && !a.Ka && (a.Ka = ct(v(a.Yd, a), 0), a.Kb = 0)
    }
    r.Yd = function (a) {
        this.Ka = n;
        this.b.info("startForwardChannel_");
        if (1 == this.e) if (a) bt(this.b, "Not supposed to retry the open");
            else {
                this.b.info("open_()");
                this.Ib = Math.floor(1E5 * Math.random());
                a = this.Ib++;
                var b = new Fs(this, this.b, "", a, h);
                b.Ta = n;
                var c = Mt(this),
                    d = this.hc.N();
                el(d, "RID", a);
                this.C && el(d, "CVER", this.C);
                Nt(this, d);
                Js(b, d, c);
                this.ea = b;
                this.e = 2
            } else 3 == this.e && (a ? Ot(this, a) : 0 == this.g.length ? this.b.info("startForwardChannel_ returned: nothing to send") : this.ea ? bt(this.b, "startForwardChannel_ returned: connection already in progress") :
                    (Ot(this), this.b.info("startForwardChannel_ finished, sent request")))
    };

    function Ot(a, b) {
        var c, d;
        b ? 6 < a.Wa ? (a.g = a.i.concat(a.g), a.i.length = 0, c = a.Ib - 1, d = Mt(a)) : (c = b.g, d = b.tb) : (c = a.Ib++, d = Mt(a));
        var e = a.hc.N();
        el(e, "SID", a.o);
        el(e, "RID", c);
        el(e, "AID", a.qb);
        Nt(a, e);
        c = new Fs(a, a.b, a.o, c, a.Kb + 1);
        c.Ta = n;
        c.setTimeout(Math.round(1E4) + Math.round(1E4 * Math.random()));
        a.ea = c;
        Js(c, e, d)
    }
    function Nt(a, b) {
        if (a.ca) {
            var c = a.ca.Oe(a);
            c && Gd(c, function (a, c) {
                el(b, c, a)
            })
        }
    }

    function Mt(a) {
        var b = Math.min(a.g.length, 1E3),
            c = ["count=" + b],
            d;
        6 < a.Wa && 0 < b ? (d = a.g[0].b, c.push("ofs=" + d)) : d = 0;
        for (var e = 0; e < b; e++) {
            var f = a.g[e].b,
                k = a.g[e].map,
                f = 6 >= a.Wa ? e : f - d;
            try {
                Gd(k, function (a, b) {
                    c.push("req" + f + "_" + b + "=" + encodeURIComponent(a))
                })
            } catch (l) {
                c.push("req" + f + "_type=" + encodeURIComponent("_badmap"))
            }
        }
        a.i = a.i.concat(a.g.splice(0, b));
        return c.join("&")
    }
    function Pt(a) {
        !a.V && !a.Da && (a.A = 1, a.Da = ct(v(a.re, a), 0), a.yb = 0)
    }

    function Qt(a) {
        if (a.V || a.Da) return bt(a.b, "Request already in progress"), p;
        if (3 <= a.yb) return p;
        a.b.info("Going to retry GET");
        a.A++;
        a.Da = ct(v(a.re, a), Rt(a, a.yb));
        a.yb++;
        return m
    }
    r.re = function () {
        this.Da = n;
        this.b.info("Creating new HttpRequest");
        this.V = new Fs(this, this.b, this.o, "rpc", this.A);
        this.V.Ta = n;
        this.V.Tc = 0;
        var a = this.Od.N();
        el(a, "RID", "rpc");
        el(a, "SID", this.o);
        el(a, "CI", this.kc ? "0" : "1");
        el(a, "AID", this.qb);
        Nt(this, a);
        if (!G || zc(10)) el(a, "TYPE", "xmlhttp"), Ls(this.V, a, m, this.lc, p);
        else {
            el(a, "TYPE", "html");
            var b = this.V,
                c = Boolean(this.lc);
            b.xb = 3;
            b.Ga = hl(a.N());
            at(b, c)
        }
        this.b.info("New Request created")
    };

    function tt(a, b, c) {
        a.b.info("Test Connection Finished");
        a.kc = c;
        a.Ca = b.Za;
        a.b.info("connectChannel_()");
        a.Kg(1, 0);
        a.hc = ot(a, a.Uc);
        Lt(a)
    }
    function vt(a, b) {
        a.b.info("Test Connection Failed");
        a.Ca = b.Za;
        st(a, 2)
    }
    r.je = function (a, b) {
        if (!(0 == this.e || this.V != a && this.ea != a)) if (this.Ca = a.Fb, this.ea == a && 3 == this.e) if (7 < this.Wa) {
                    var c;
                    try {
                        c = this.j.parse(b)
                    } catch (d) {
                        c = n
                    }
                    if (ga(c) && 3 == c.length) {
                        var e = c;
                        if (0 == e[0]) a: if (this.b.info("Server claims our backchannel is missing."), this.Da) this.b.info("But we are currently starting the request.");
                            else {
                                if (this.V) if (this.V.Gb + 3E3 < this.ea.Gb) Kt(this), et(this.V), this.V = n;
                                    else break a;
                                    else Xs(this.b, "We do not have a BackChannel established");
                                Qt(this);
                                Ws()
                            } else this.Vd = e[1], c = this.Vd -
                                    this.qb, 0 < c && (e = e[2], this.b.info(e + " bytes (in " + c + " arrays) are outstanding on the BackChannel"), 37500 > e && (this.kc && 0 == this.yb) && !this.$a && (this.$a = ct(v(this.Ef, this), 6E3)))
                    } else this.b.info("Bad POST response data returned"), st(this, 11)
                } else "y2f%" != b && (this.b.info("Bad data returned - missing/invald magic cookie"), st(this, 11));
                else if (this.V == a && Kt(this), !sa(b)) {
            c = this.j.parse(b);
            ga(c);
            for (e = 0; e < c.length; e++) {
                var f = c[e];
                this.qb = f[0];
                f = f[1];
                2 == this.e ? "c" == f[0] ? (this.o = f[1], this.lc = f[2], f = f[3], f !=
                    n ? this.Wa = f : this.Wa = 6, this.e = 3, this.ca && this.ca.Ud(this), this.Od = ut(this, this.lc, this.Uc), Pt(this)) : "stop" == f[0] && st(this, 7) : 3 == this.e && ("stop" == f[0] ? st(this, 7) : "noop" != f[0] && this.ca && this.ca.Td(this, f), this.yb = 0)
            }
        }
    };
    r.Ef = function () {
        this.$a != n && (this.$a = n, et(this.V), this.V = n, Qt(this), Ws())
    };

    function Kt(a) {
        a.$a != n && (s.clearTimeout(a.$a), a.$a = n)
    }
    r.gc = function (a) {
        this.b.info("Request complete");
        var b;
        if (this.V == a) Kt(this), this.V = n, b = 2;
        else if (this.ea == a) this.ea = n, b = 1;
        else return;
        this.Ca = a.Fb;
        if (0 != this.e) if (a.ra) 1 == b ? (w(), Gn(Ft, new Ht(Ft)), Lt(this), this.i.length = 0) : Pt(this);
            else {
                var c = a.Ia;
                if (3 == c || 7 == c || 0 == c && 0 < this.Ca) this.b.info("Not retrying due to error type");
                else {
                    this.b.info("Maybe retrying, last error: " + Gs(c, this.Ca));
                    var d;
                    if (d = 1 == b) this.ea || this.Ka ? (bt(this.b, "Request already in progress"), d = p) : 1 == this.e || 2 <= this.Kb ? d = p : (this.b.info("Going to retry POST"),
                            this.Ka = ct(v(this.Yd, this, a), Rt(this, this.Kb)), this.Kb++, d = m);
                    if (d || 2 == b && Qt(this)) return;
                    this.b.info("Exceeded max number of retries")
                }
                this.b.info("Error: HTTP request failed");
                switch (c) {
                    case 1:
                        st(this, 5);
                        break;
                    case 4:
                        st(this, 10);
                        break;
                    case 3:
                        st(this, 6);
                        break;
                    case 7:
                        st(this, 12);
                        break;
                    default:
                        st(this, 2)
                }
            }
    };

    function Rt(a, b) {
        var c = 5E3 + Math.floor(1E4 * Math.random());
        a.ca || (a.b.info("Inactive channel"), c *= 2);
        return c * b
    }
    r.Kg = function (a) {
        Sa(arguments, this.e) || g(Error("Unexpected channel state: " + this.e))
    };

    function st(a, b) {
        a.b.info("Error code " + b);
        if (2 == b || 9 == b) {
            var c = n;
            a.ca && (c = n);
            var d = v(a.Mg, a);
            c || (c = new Sk("//www.google.com/images/cleardot.gif"), hl(c));
            lt(c.toString(), 1E4, d)
        } else Ws();
        St(a, b)
    }
    r.Mg = function (a) {
        a ? (this.b.info("Successfully pinged google.com"), Ws()) : (this.b.info("Failed to ping google.com"), Ws(), St(this, 8))
    };

    function St(a, b) {
        a.b.info("HttpChannel: error - " + b);
        a.e = 0;
        a.ca && a.ca.ie(a, b);
        Tt(a);
        Jt(a)
    }

    function Tt(a) {
        a.e = 0;
        a.Ca = -1;
        if (a.ca) if (0 == a.i.length && 0 == a.g.length) a.ca.bd(a);
            else {
                a.b.info("Number of undelivered maps, pending: " + a.i.length + ", outgoing: " + a.g.length);
                var b = Ya(a.i),
                    c = Ya(a.g);
                a.i.length = 0;
                a.g.length = 0;
                a.ca.bd(a, b, c)
            }
    }
    function ot(a, b) {
        var c = rt(a, n, b);
        a.b.info("GetForwardChannelUri: " + c);
        return c
    }
    function ut(a, b, c) {
        b = rt(a, a.jc() ? b : n, c);
        a.b.info("GetBackChannelUri: " + b);
        return b
    }

    function rt(a, b, c) {
        var d = c instanceof Sk ? c.N() : new Sk(c, h);
        if ("" != d.Db) b && Uk(d, b + "." + d.Db), Vk(d, d.Vb);
        else var e = window.location,
        d = il(e.protocol, b ? b + "." + e.hostname : e.hostname, e.port, c);
        a.Tb && Gd(a.Tb, function (a, b) {
            el(d, b, a)
        });
        el(d, "VER", a.Wa);
        Nt(a, d);
        return d
    }
    r.Vc = function (a) {
        a && g(Error("Can't create secondary domain capable XhrIo object."));
        a = new wt;
        a.ce = p;
        return a
    };

    function ct(a, b) {
        ja(a) || g(Error("Fn must not be null and must be a function"));
        return s.setTimeout(function () {
            a()
        }, b)
    }
    r.qa = function () {
        Gn(Ft, new It(Ft))
    };

    function Ws() {
        Gn(Ft, new Gt(Ft))
    }
    r.jc = function () {
        return !(!G || zc(10))
    };

    function Ut() {}
    r = Ut.prototype;
    r.Ud = function () {};
    r.Td = function () {};
    r.ie = function () {};
    r.bd = function () {};
    r.Oe = function () {
        return {}
    };

    function Vt(a, b) {
        Hn.call(this);
        ja(a) ? b && (a = v(a, b)) : a && ja(a.handleEvent) ? a = v(a.handleEvent, a) : g(Error("Invalid listener argument"));
        this.C = a;
        im(this, "tick", v(this.A, this));
        this.stop();
        Jn(this, 5E3 + 2E4 * Math.random())
    }
    y(Vt, Hn);
    Vt.prototype.A = function () {
        if (500 < this.b) {
            this.stop();
            var a = this.b;
            24E4 > 2 * a && (a *= 2);
            Jn(this, a);
            this.start()
        }
        this.C()
    };

    function Wt(a, b) {
        this.action = a;
        this.params = b || n
    };

    function Xt(a, b) {
        this.j = a;
        this.o = b;
        this.g = new Fb;
        this.e = new Vt(this.Cf, this);
        this.b = n
    }
    y(Xt, Ut);
    r = Xt.prototype;
    r.ic = "";
    r.mc = p;
    r.cd = p;
    r.aa = function (a, b, c) {
        this.g.aa(a, b, c)
    };
    r.va = function (a, b, c) {
        this.g.va(a, b, c)
    };
    r.M = function (a, b) {
        this.g.M.apply(this.g, arguments)
    };
    r.connect = function (a, b, c) {
        if (!(this.b && 2 == this.b.e)) {
            this.ic = "";
            this.e.stop();
            this.i = a || n;
            this.mc = !! b;
            a = this.j + "/test";
            b = this.j + "/bind";
            var d = new Dt("1", c ? c.firstTestResults : n, c ? c.secondTestResults : n),
                e = this.b;
            e && (e.ca = n);
            d.ca = this;
            this.b = d;
            e ? this.b.connect(a, b, this.o, e.o, e.qb) : c ? this.b.connect(a, b, this.o, c.sessionId, c.arrayId) : this.b.connect(a, b, this.o)
        }
    };

    function Yt(a) {
        a.cd = m;
        a.e.stop();
        if (a.b && 0 != a.b.e) {
            var b = a.b;
            b.b.info("disconnect()");
            Jt(b);
            if (3 == b.e) {
                var c = b.Ib++,
                    d = b.hc.N();
                el(d, "SID", b.o);
                el(d, "RID", c);
                el(d, "TYPE", "terminate");
                Nt(b, d);
                c = new Fs(b, b.b, b.o, c, h);
                c.xb = 2;
                c.Ga = hl(d.N());
                (new Image).src = c.Ga;
                c.Gb = w();
                Ms(c)
            }
            Tt(b)
        }
        a.cd = p
    }
    r.sendMessage = function (a, b) {
        if (this.b && !(0 == this.b.e || !(2 == this.b.e || 3 == this.b.e) && !this.e.e)) {
            var c = {
                _sc: a
            };
            b && pb(c, b);
            Rd(c);
            var d = this.b;
            0 == d.e && g(Error("Invalid operation: sending map when state is closed"));
            1E3 == d.g.length && bt(d.b, "Already have 1000 queued maps upon queueing " + Rd(c));
            d.g.push(new Et(d.Nf++, c));
            (2 == d.e || 3 == d.e) && Lt(d)
        }
    };
    r.Ud = function () {
        var a = this.e;
        a.stop();
        Jn(a, 5E3 + 2E4 * Math.random());
        this.i = n;
        this.mc = p;
        this.M("onStateOpened")
    };
    r.ie = function (a, b) {
        var c = 2 == b && 401 == this.b.Ca;
        4 != b && !c && (6 == b && (c = this.e, c.stop(), Jn(c, 500)), this.e.start());
        this.M("onError", b)
    };
    r.bd = function () {
        this.M("onStateClosed")
    };
    r.Oe = function () {
        var a = {
            v: 2
        };
        this.ic && (a.gsessionid = this.ic);
        if (this.cd || this.mc) a.ui = "true";
        this.i && pb(a, this.i);
        return a
    };
    r.Td = function (a, b) {
        "S" == b[0] ? this.ic = b[1] : this.g.M("onMessage", new Wt(b[0], b[1]))
    };
    r.Cf = function () {
        this.e.stop();
        var a = this.b,
            b = 0;
        a.V && b++;
        a.ea && b++;
        0 != b ? this.e.start() : this.connect(this.i, this.mc)
    };

    function Zt(a) {
        this.Z = [];
        this.index = -1;
        $t(this);
        a && (this.screen = new Wr(a.screen), this.Z = a.videoIds, this.index = a.index, this.b = a.playerState, this.volume = a.volume, this.g = a.playerTime, this.e = a.playerTimeAt)
    }
    function $t(a) {
        a.volume = -1;
        a.b = -1;
        a.g = 0;
        a.e = w()
    }
    function au(a, b) {
        var c = a.index;
        a.index = La(a.Z, b);
        c != a.index && $t(a)
    }
    function bu(a, b, c) {
        c = c || a.Z[a.index];
        if (db(a.Z, b) && c == a.Z[a.index]) return p;
        a.Z = Ya(b);
        au(a, c);
        return m
    }
    Zt.prototype.add = function (a, b) {
        return a && !Sa(this.Z, a) ? (!b || -1 < this.index && this.index >= this.Z.length - 1 ? this.Z.push(a) : this.Z.splice(this.index + 1, 0, a), m) : p
    };
    Zt.prototype.remove = function (a) {
        var b = this.Z[this.index];
        return Va(this.Z, a) ? (this.index = La(this.Z, b), m) : p
    };

    function cu(a) {
        var b = {};
        b.screen = Xr(a.screen);
        b.videoIds = a.Z;
        b.index = a.index;
        b.playerState = a.b;
        b.volume = a.volume;
        b.playerTime = a.g;
        b.playerTimeAt = a.e;
        return b
    };

    function du() {
        vs.call(this);
        this.Q = gs(rs());
        this.e = [];
        this.b = [];
        eu(this, Rr);
        fu(this);
        this.ge();
        this.zc();
        var a = w() + 6E4,
            b = Pb(function () {
                Pr();
                (Nr || w() > a) && window.clearInterval(b)
            }, 1E3)
    }
    y(du, vs);
    var gu = [2E3, 2E3, 1E3, 1E3, 1E3, 2E3, 2E3, 5E3, 1E4, 15E3, 2E4];
    r = du.prototype;
    r.wd = NaN;

    function hu(a) {
        var b = navigator.userAgent;
        if (0 <= b.search("MSIE") && (b = b.match(/MSIE ([\d.]+)/)[1], 0 > Ga(b, "10.0"))) return a;
        b = se(document.location.href);
        return qe("https", n, b[3], n, a)
    }

    function fu(a) {
        a.aa("appScreenChange", a.zh, a);
        E("yt-remote-dial-device-list-update", function (a) {
            eu(this, a);
            Ta(a) || this.zc()
        }, a);
        E("yt-remote-dial-device-status-update", a.Ah, a)
    }
    r.ge = function () {
        iu(this);
        D(v(this.ge, this), 864E5)
    };
    r.zc = function () {
        Qb(this.wd);
        this.wd = NaN;
        var a = p;
        Ta(this.Q) || (ju(this), a = m);
        var b = Rr;
        Ta(b) || (eu(this, b), a = m);
        a && (this.wd = D(v(this.zc, this), 1E4))
    };
    r.zh = function () {
        var a = Ma(this.Q, function (a) {
            return !!js(this.e, a)
        }, this);
        ku(this, a);
        eu(this, Rr);
        (!Ta(this.Q) || !Ta(this.b)) && this.zc()
    };

    function eu(a, b) {
        z(b, function (a) {
            var b = ks(this.Q, a.id);
            b && (a.name = b.name)
        }, a);
        ts($r(b));
        db(a.b, b, cs) || (a.b = b, a.M("onlineReceiverChange"))
    }
    r.Ah = function (a) {
        var b = ds(this.b, a.id);
        b && (b.status = a.status)
    };

    function ku(a, b, c) {
        var d = !db(a.e, b, is);
        if (d || c) c = fs(b), pf("yt-remote-online-screens", c, 60);
        d && (a.e = b, a.M("onlineReceiverChange"))
    }

    function lu(a) {
        var b = [],
            c = {};
        z(a.Q, function (a) {
            c[a.wa] = a;
            b.push(a.wa)
        });
        a = {
            method: "POST",
            F: {
                lounge_token: b.join(",")
            },
            R: a,
            B: function (a, b) {
                var f = [];
                z(b.screens || [], function (a) {
                    "online" == a.status && f.push(c[a.loungeToken])
                });
                ku(this, f, m)
            }
        };
        R(hu("/api/lounge/pairing/get_screen_availability"), a)
    }

    function iu(a) {
        var b = Na(a.Q, function (a) {
            return a.za
        });
        Ta(b) || R(hu("/api/lounge/pairing/get_lounge_token_batch"), {
            F: {
                screen_ids: b.join(",")
            },
            method: "POST",
            R: a,
            B: function (a, b) {
                z(b.screens || [], function (a) {
                    var b = Qa(this.Q, function (b) {
                        return b.za == a.screenId
                    });
                    b && (b.wa = a.loungeToken)
                }, this);
                this.Q = Ma(this.Q, function (a) {
                    return !!a.wa
                });
                mu(this);
                lu(this)
            }
        })
    }

    function ju(a) {
        var b = a.Q,
            c = gs(rs());
        a.Q = 0 < c.length ? c : a.Q;
        db(a.Q, b, is) || a.M("appScreenChange");
        Ta(a.Q) || (Qa(a.Q, function (a) {
            return !a.wa
        }) ? iu(a) : lu(a))
    }
    function mu(a) {
        5 < a.Q.length && (a.Q = a.Q.slice(a.Q.length - 5));
        var b = gs(rs());
        db(a.Q, b, is) || (b = fs(a.Q), pf("yt-remote-app-screens", b, 31536E3), a.M("appScreenChange"))
    }
    function nu(a, b) {
        var c = Ra(a.Q, function (a) {
            return hs(b, a)
        });
        0 > c ? (a.Q.push(b), a.e.push(b)) : a.Q[c] = b;
        mu(a)
    }
    r.qe = function (a, b, c) {
        b >= gu.length || R(hu("/api/lounge/pairing/get_screen"), {
            method: "POST",
            F: {
                pairing_code: c
            },
            R: this,
            B: function (b, c) {
                var f = new Wr(c.screen);
                f.name = a.name;
                f.b = a.id;
                nu(this, f)
            },
            onError: function () {
                D(v(this.qe, this, a, b + 1, c), gu[b])
            }
        })
    };

    function ou(a, b, c) {
        var d = ds(a.b, b);
        if (d) {
            var e = Yr(),
                f = Vr(b);
            f && (b in Tr && (Nr.stopActivity(Tr[b], ca), delete Tr[b]), b = new cast.Receiver(f.id, f.name), b = new cast.LaunchRequest("YouTube", b), b.parameters = "pairingCode=" + e, b.description = new cast.LaunchDescription, b.description.text = document.title, c && (b.parameters += "&v=" + c, b.description.url = "http://i.ytimg.com/vi/" + c + "/default.jpg"), Nr.launch(b, qa(Sr, f)));
            D(v(a.qe, a, d, 0, e), gu[0])
        }
    }

    function pu(a, b) {
        var c = ds(a.b, b);
        if (!c) {
            var d = ks(a.Q, b);
            d && (c = ds(a.b, d.b))
        }
        return c
    };

    function qu() {
        vs.call(this);
        sf();
        this.g = new du;
        var a = rf("yt-remote-device-id");
        a || (a = Yr(), pf("yt-remote-device-id", a, 31536E3));
        this.e = new Xt("/api/lounge/bc", {
            device: "REMOTE_CONTROL",
            id: a,
            name: "Desktop",
            app: "youtube-desktop"
        });
        this.b = n;
        this.e.aa("onStateOpened", this.If, this);
        this.e.aa("onStateClosed", this.Xd, this);
        this.e.aa("onError", this.Gf, this);
        this.e.aa("onMessage", this.Hf, this);
        this.g.aa("appScreenChange", this.Ff, this)
    }
    y(qu, vs);
    r = qu.prototype;
    r.Cc = NaN;
    r.sd = NaN;

    function ru() {
        var a = rf(ms("yt-remote-session-screen"));
        return a ? new Wr(a) : n
    }
    function su(a, b) {
        a.j = b;
        a.e.o.loungeIdToken = b ? b.wa : ""
    }
    r.connect = function (a) {
        var b = ks(this.g.e, a.key);
        a = pu(this.g, a.key);
        b ? a && "STOPPED" == a.status ? tu(this, a) : uu(this, b) : a ? tu(this, a) : D(v(function () {
            this.M("connectionError")
        }, this), 0)
    };

    function vu(a) {
        var b = {};
        if (a.i) var b = a.i.b(),
        c = b[a.i.e()], b = {
            method: "setPlaylist",
            params: Rd({
                videoIds: b.join(","),
                videoId: c,
                videoSources: a.i.i().join(","),
                currentTime: a.i.g()
            })
        };
        return b
    }

    function uu(a, b) {
        var c = ru();
        c && !hs(b, c) ? wu(a) : Yt(a.e);
        a.b = n;
        su(a, b);
        a.e.connect(vu(a), m, rf(ms("yt-remote-session-browser-channel")));
        xu(a)
    }
    function tu(a, b) {
        yu(a);
        zu(a);
        if (a.i) {
            var c = a.i.b()[a.i.e()];
            ou(a.g, b.id, c)
        } else ou(a.g, b.id);
        a.C = b;
        Au(a)
    }
    r.Ge = function () {
        var a = ks(this.g.e, this.C.id);
        a && (yu(this), uu(this, a))
    };

    function wu(a) {
        os();
        Yt(a.e);
        zu(a)
    }
    function zu(a) {
        if (a.C) {
            var b = a.C.id,
                c = Vr(b);
            c && b in Tr && Nr.stopActivity(Tr[b], qa(Ur, c));
            a.C = n
        }
    }
    function Bu(a) {
        return !!a.j && isNaN(a.Cc)
    }

    function xu(a) {
        a.Cc = D(v(function () {
            this.b = n;
            Cu(this);
            this.M("connectionError")
        }, a), 1E4)
    }
    function Cu(a) {
        Qb(a.Cc);
        a.Cc = NaN
    }
    function Au(a) {
        a.sd = D(v(function () {
            yu(this);
            this.M("connectionError")
        }, a), 2E4);
        a.g.aa("onlineReceiverChange", a.Ge, a)
    }
    function yu(a) {
        Qb(a.sd);
        a.sd = NaN;
        a.g.va("onlineReceiverChange", a.Ge, a)
    }
    r.If = function () {
        ns(Xr(this.j));
        !Bu(this) && this.b && (Cu(this), this.M("connectionChange", m), this.e.sendMessage("getNowPlaying"))
    };
    r.Xd = function () {
        var a = {
            firstTestResults: [""],
            secondTestResults: !this.e.b.kc,
            sessionId: this.e.b.o,
            arrayId: this.e.b.qb
        };
        pf(ms("yt-remote-session-browser-channel"), a, 30);
        a = Bu(this);
        su(this, n);
        a && (this.M("connectionChange", p), this.b && ps(cu(this.b)))
    };
    r.Gf = function () {
        this.Xd();
        Cu(this);
        this.M("connectionError")
    };

    function Du(a, b) {
        var c = p;
        if ("loungeStatus" == b.action) c = Pd(b.params.devices), c = !! Qa(c, function (a) {
                return "LOUNGE_SCREEN" == a.type
            });
        else if ("loungeScreenConnected" == b.action) c = m;
        else if ("loungeScreenDisconnected" == b.action) c = p;
        else return;
        c != Bu(a) && (c ? (Cu(a), a.b = new Zt, a.b.screen = a.j, a.M("connectionChange", m), a.e.sendMessage("getNowPlaying")) : wu(a))
    }
    r.Hf = function (a) {
        Du(this, a);
        if (Bu(this)) {
            var b = p,
                c = p,
                d, e, f, k, l;
            a.params && (d = a.params.videoId || a.params.video_id, e = a.params.videoIds || a.params.video_ids, f = a.params.state, k = a.params.currentTime || a.params.current_time, l = a.params.volume);
            if (this.b.Z[this.b.index] || '"onStateChange"' != a.action) a.params && !e && ("videoIds" in a.params || "video_ids" in a.params) ? (bu(this.b, []), b = m) : (!d && ("nowPlaying" == a.action || "nowPlayingPlaylist" == a.action) ? (au(this.b, ""), b = m) : d ? d != this.b.Z[this.b.index] && (b = m) : d = this.b.Z[this.b.index],
                    e && (e = e.split(","), bu(this.b, e, d) && (b = m))), this.b.add(d) && this.e.sendMessage("getPlaylist"), d && au(this.b, d), b && this.M("playlistChange"), f && (a = parseInt(f, 10), a = isNaN(a) ? -1 : a, c = c || a != this.b.b, this.b.b = a), k && (a = parseInt(k, 10), c = this.b, c.g = isNaN(a) ? 0 : a, c.e = w(), c = m), l && 2E3 < w() && (a = parseInt(l, 10), isNaN(a) || (c = c || this.b.volume != a, this.b.volume = a)), c && this.M("playerChange")
        }
    };
    r.Ff = function () {
        var a = gs(rs()),
            b = ru();
        b && ((a = js(a, b)) ? is(a, b) || ns(Xr(a)) : os());
        b = ru();
        if (a = (a = rf(ms("yt-remote-session-player-context"))) ? new Zt(a) : n) hs(a.screen, b) ? is(a.screen, b) || (a.screen = b, ps(cu(a))) : qs();
        b = gs(rs());
        this.j && ((b = js(b, this.j)) ? is(b, this.j) || (su(this, b), this.b && (this.b.screen = b, ps(cu(this.b)))) : (wu(this), this.b = n, qs()))
    };

    function Eu() {
        qu.call(this);
        U(window, "unload", v(this.K, this));
        U(window, "beforeunload", v(this.K, this))
    }
    y(Eu, qu);
    da(Eu);
    Eu.prototype.K = function () {
        Yt(this.e)
    };
    var Fu = {};

    function Gu(a, b, c) {
        a = L(a);
        if (!a) return n;
        b = ir(b);
        var d = "player" + la(a),
            e = Fu[d];
        e && (L(e.g) && L(e.g).loadVideoByPlayerVars ? Hu(e, b) : (e.Ed(), e = n));
        e || (e = new Iu(a, d, b, c), Fu[d] = e, D(function () {
            e.fc();
            F("player-added", e.e)
        }, 0));
        return e.e
    }
    function Ju(a, b, c) {
        return Gu(a, b, {
            force: c
        })
    }
    function Ku(a) {
        if (a = L(a)) {
            a = "player" + la(a);
            var b = Fu[a];
            b && b.ma();
            Fu[a] = n
        }
    }

    function Lu(a) {
        a = Fu[a];
        if (!a.K) {
            a.K = m;
            for (var b = L(a.g), c = b.getApiInterface(), d = 0; d < c.length; d++) {
                var e = c[d];
                "addEventListener" == e ? a.U = v(b[e], b) : "destroy" == e ? a.Aa = v(b[e], b) : "removeEventListener" == e ? a.Ra = v(b[e], b) : a.e[e] = v(b[e], b)
            }
            for (var f in a.j) a.U(f, a.j[f]);
            a.dc("onTabOrderChange", v(a.eg, a));
            a.dc("onNavigate", v(a.gg, a));
            "flash" == a.i && a.dc("onRemoteScreenSelected", v(a.fg, a));
            Eu.getInstance().g.aa("onlineReceiverChange", a.Fd, a);
            a.Ba && a.Ba(a.e);
            a.ba.M("onReady", a.e)
        }
        F("player-ready", a.e)
    }

    function Iu(a, b, c, d) {
        this.Sa = this.A = a;
        this.Rc = b;
        this.e = {
            addEventListener: v(this.dc, this),
            removeEventListener: v(this.qf, this),
            destroy: v(this.Ed, this),
            getPlayerType: v(this.of, this),
            writePlayer: v(this.fc, this),
            isReady: v(this.pf, this)
        };
        this.Aa = this.Ra = this.U = n;
        this.ba = new Fb;
        Db(this, qa(Eb, this.ba));
        this.j = {};
        this.K = this.pa = p;
        this.Ba = this.Dd = this.g = this.C = this.b = n;
        this.i = "flash";
        this.ob = {};
        this.nf = ["onReady"];
        Mu(this, c, d);
        if (a = this.b.attrs.width) this.A.style.width = Wf(Number(a) || a, m);
        (a = this.b.attrs.height) &&
            Xf(this.A, Number(a) || a);
        Jf(this.A, "overflow", "hidden")
    }
    y(Iu, Cb);

    function Mu(a, b, c) {
        a.b = b.N();
        a.g = a.b.attrs.id;
        a.A.id == a.g && (a.g = a.g + "-player", a.b.attrs.id = a.g);
        a.Dd = a.b.args.el;
        a.C = c || n;
        if (!(b = a.b.args.eurl)) b = document.location.toString(), b = -1 != b.indexOf("/embed/") ? document.referrer && document.referrer.substring(0, 128) || "unknown" : b;
        a.b.args.eurl = b;
        a.b.args.enablejsapi = "1";
        a.b.args.playerapiid = a.Rc;
        if (!Mr() || !t("yt.player.Application") && !a.b.assets.js) a.b.args.html5_unavailable = "1", a.b.disable.html5 = m;
        a.b.fallback = v(a.ee, a);
        a.Ba || (a.Ba = Nu(a, a.b.args.jsapicallback ||
            "onYouTubePlayerReady"));
        a.b.args.jsapicallback = "ytPlayerOnYouTubePlayerReady"
    }
    function Hu(a, b) {
        Mu(a, b);
        "0" != b.args.autoplay ? a.e.loadVideoByPlayerVars(a.b.args) : a.e.cueVideoByPlayerVars(a.b.args)
    }
    r = Iu.prototype;
    r.fg = function (a) {
        var b = us();
        Zr(b, a) && "html5" != this.i && (pf("yt-remote-delayed-connect-key", a), this.fc("html5"))
    };
    r.ee = function (a) {
        a = ir(a || this.b);
        var b = m;
        "flash" == this.i ? (a.disable.flash = m, this.pa && (b = p)) : "html5" == this.i && (a.disable.flash ? b = p : (a.args.autoplay = 1, a.args.html5_unavailable = "1", a.disable.html5 = m));
        b && (Mu(this, a), this.fc())
    };
    r.fc = function (a) {
        if (!this.o) {
            if (!a) {
                a = !! this.b.disable.html5;
                var b = !! this.b.disable.flash;
                a = (this.b.html5 || b) && !a ? "html5" : b ? "unsupported" : "flash"
            }("flash" == a ? this.Jg : "html5" == a ? this.fe : this.Ig).call(this)
        }
    };
    r.fe = function () {
        this.i = "html5";
        var a = this.b.N(),
            b = t("yt.player.Application");
        b ? this.C ? (this.jd(), this.C = n) : (this.pa = p, cd(this.Sa), this.pa = m, this.K = p, new b(this.Sa, a)) : (a = v(this.fe, this), xb(this.b.assets.js, a))
    };
    r.Jg = function () {
        this.i = "flash";
        var a = this.b.N();
        a.attrs.width = a.attrs.width || "100%";
        a.attrs.height = a.attrs.height || "100%";
        this.C ? (wr(a, !! this.C.force, v(this.jd, this)), this.C = n) : (this.K = p, tr(this.Sa, a))
    };
    r.jd = function () {
        var a = L(this.g);
        !a || !a.getApiInterface ? D(v(this.jd, this), 50) : a.hasFallbackHappened && a.hasFallbackHappened() ? this.ee() : Lu(this.Rc)
    };
    r.pf = function () {
        return this.K
    };
    r.Fd = function () {
        this.e.updateRemoteScreens && this.e.updateRemoteScreens(us())
    };
    r.dc = function (a, b) {
        var c = Nu(this, b);
        if (c) {
            if (!Sa(this.nf, a) && !this.j[a]) {
                var d = Ou(this, a);
                this.U && this.U(a, d)
            }
            this.ba.aa(a, c)
        }
    };
    r.qf = function (a, b) {
        var c = Nu(this, b);
        c && this.ba.va(a, c)
    };

    function Nu(a, b) {
        var c = b;
        if ("string" == typeof b) {
            if (a.ob[b]) return a.ob[b];
            c = function () {
                var a = t(b);
                a && a.apply(s, arguments)
            };
            a.ob[b] = c
        }
        return !c ? n : c
    }
    function Ou(a, b) {
        var c = "ytPlayer" + b + a.Rc;
        a.j[b] = c;
        s[c] = function (c) {
            D(function () {
                a.o || a.ba.M(b, c)
            }, 0)
        };
        return c
    }
    r.eg = function (a) {
        a = a ? nd : md;
        for (var b = a(document.activeElement); b && !(1 == b.nodeType && (b.focus(), b == document.activeElement));) b = a(b)
    };
    r.gg = function (a) {
        var b = B("EVENT_ID");
        b && Ri(a.url, {
            ei: b,
            feature: a.feature
        })
    };
    r.Ig = function () {
        var a = Sb("PLAYER_FALLBACK_OVERRIDE");
        if (!a) {
            var a = Sb("PLAYER_FALLBACK", h, 'The Adobe Flash Player or an HTML5 supported browser is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/">Get the latest Flash Player</a> <br> <a href="/html5">Learn more about upgrading to an HTML5 browser</a>'),
                b = navigator.userAgent.match(/Version\/(\d).*Safari/);
            b && 5 <= parseInt(b[1], 10) && (a = Sb("QUICKTIME_FALLBACK", h, 'The Adobe Flash Player or QuickTime is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/">Get the latest Flash Player</a> <br> <a href="http://www.apple.com/quicktime/download/">Get the latest version of QuickTime</a>'))
        }
        this.A.innerHTML =
            '<div class="ytp-fallback"><div class="ytp-fallback-content">' + a + "</div></div>";
        if ("embedded" == this.Dd) {
            a = this.A.getElementsByTagName("a");
            for (b = 0; b < a.length; b++) a[b].setAttribute("target", "_blank")
        }
    };
    r.of = function () {
        return this.i
    };
    r.Ed = function () {
        Pu(this.A)
    };
    r.P = function () {
        this.ob = n;
        for (var a in this.j) this.Ra && this.Ra(a, this.j[a]), delete s[this.j[a]];
        this.Ra = this.U = n;
        this.Aa && (this.Aa(), this.Aa = n);
        this.e = n;
        this.b = this.b.fallback = n;
        this.pa = p;
        cd(this.Sa);
        Eu.getInstance().g.va("onlineReceiverChange", this.Fd, this);
        Iu.L.P.call(this)
    };
    var Qu = t("yt.player.embed") || Gu;
    x("yt.player.embed", Qu);
    var Ru = t("yt.player.update") || Ju;
    x("yt.player.update", Ru);
    var Pu = t("yt.player.destroy") || Ku;
    x("yt.player.destroy", Pu);
    t("ytPlayerOnYouTubePlayerReady") || x("ytPlayerOnYouTubePlayerReady", Lu);
    var Su, Tu;

    function Uu() {
        if (!Su) {
            var a = t("ytplayer.config");
            if (a) {
                var b = a = ir(a),
                    c = p;
                b.args.jsapicallback = Vu;
                var d;
                var e = Ge(window.location.hash);
                (d = e.t || e.at) ? (Wu.t = e.t, Wu.at = e.at, e = window.location.hash.replace(/\bat=[^&]*&?/, ""), window.location.hash = e && "#" != e ? e : "#!", d = zk(d)) : d = 0;
                d && (b.args.start = d, b.args.resume = 1, c = m);
                a = Ru("player-api", a, c);
                Mb({
                    PLAYER_REFERENCE: a
                });
                Su = a;
                a.addEventListener("onStateChange", Xu);
                a.addEventListener("onVolumeChange", Yu);
                a.addEventListener("RATE_SENTIMENT", Zu);
                a.addEventListener("SHARE_CLICKED", $u);
                a.addEventListener("SIZE_CLICKED", av);
                a.addEventListener("onError", bv);
                a.addEventListener("WATCH_LATER", cv);
                a.addEventListener("onAdStart", dv);
                Pr();
                U(window, "message", ev);
                fv();
                gv = Pb(fv, 1E3);
                hv.push(E("player-shortcut-rewind", iv));
                hv.push(E("player-shortcut-fast-forward", jv));
                hv.push(E("player-shortcut-play-pause", kv))
            }
        }
    }

    function lv(a, b) {
        var c = mv();
        if (c) {
            var d = Pi(c, "").split(","),
                d = Ma(d, function (b) {
                    return 0 != b.indexOf(a) && !! b.length
                });
            4 <= d.length && d.shift();
            d.push(a + ":" + b);
            Oi(c, d.join(","), 1814400)
        }
    }
    function nv(a) {
        var b = mv();
        if (b) {
            var c = Pi(b, "").split(","),
                c = Ma(c, function (b) {
                    return 0 != b.indexOf(a)
                });
            0 == c.length ? Qi(b) : Oi(b, c.join(","), 1814400)
        }
    }

    function ov(a) {
        var b = Ck();
        if (b) {
            a && Mb("RESUME_COOKIE_NAME", a);
            a = B("VIDEO_ID");
            var c = b.getDuration(),
                b = Math.floor(b.getCurrentTime());
            0 == c || 120 >= b || b + 120 >= c ? nv(a) : lv(a, Math.floor(b))
        }
    }
    function pv() {
        ov();
        if (B("IS_RESUMABLE_PLAYBACK")) {
            var a = Su;
            if (a) {
                var b = B("VIDEO_ID"),
                    c = a.getDuration(),
                    a = Math.floor(a.getCurrentTime());
                0 == c || 20 >= a || vf("/save_resume_204?" + He({
                    v: b,
                    t: a.toString()
                }))
            }
        }
    }
    function ev(a) {
        "CastApi" == a.data.source && "Hello" == a.data.event && Pr()
    }

    function Vu() {
        qv = m;
        mv() && U(window, "beforeunload", pv);
        Tu = new jr;
        (!Ta(ss()) || !Ta(bs())) && Su.updateRemoteScreens(us())
    }
    function Xu(a) {
        F("player-state-change", a)
    }
    function bv(a) {
        F("player-error", a)
    }
    function Yu(a) {
        var b = Tu;
        if (b.b) {
            var c = {};
            c.volume = isNaN(a.volume) ? kr(b).volume : Math.min(Math.max(a.volume, 0), 100);
            c.nonNormalized = a.nonNormalized;
            c.muted = a.muted == h ? kr(b).muted : a.muted;
            try {
                b.b.set("yt-player-volume", c)
            } catch (d) {}
        }
    }
    function av(a) {
        Oi("wide", a ? "1" : "0");
        F("player-resize", a)
    }

    function Zu(a) {
        F("player-sentiment", a)
    }
    function $u() {
        F("player-share")
    }
    function cv() {
        F("player-watchlater")
    }
    function dv(a) {
        F("player-ad-start", a)
    }
    function kv() {
        var a = Su;
        a && (2 == a.getPlayerState() ? a.playVideo() : a.pauseVideo())
    }
    function jv() {
        var a = Su;
        if (a) {
            var b = a.getCurrentTime();
            a.seekTo(b + 10)
        }
    }
    function iv() {
        var a = Su;
        if (a) {
            var b = a.getCurrentTime();
            a.seekTo(b - 10)
        }
    }
    function rv(a, b) {
        var c = Su;
        if (c) {
            var d = b != n ? b : m;
            c.seekTo(a, m);
            d && window.scroll(0, 0);
            c.playVideo()
        }
    }

    function fv() {
        if (qv) {
            var a = window.location.hash;
            a != sv && (sv = a, a = Ge(a), "t" in a && a.t != Wu.t && rv(zk(a.t), p), Wu = a)
        }
    }
    function mv() {
        return B("RESUME_COOKIE_NAME")
    }
    var hv = [],
        qv = p,
        sv = "",
        Wu = {}, gv = 0;

    function tv(a, b, c, d, e) {
        this.D = a;
        this.Zc = p;
        a = ve() + "/share_ajax";
        c = {
            action_get_email: 1,
            video_id: c,
            list: d
        };
        e && (c.new_share = 1);
        R(a, {
            format: "JSON",
            G: c,
            B: function (a, c) {
                this.D.innerHTML = c.email_html;
                this.Xb();
                this.focus();
                var d = c.sharing_binary_url;
                d && uv(this, d, c.contacts, b)
            },
            R: this
        })
    }
    r = tv.prototype;
    r.Xb = function () {
        this.O = this.D.getElementsByTagName("form")[0];
        U(this.O, "submit", v(this.Bf, this));
        N("share-email-send", this.O);
        this.Wc = N("share-email-success", this.D);
        this.i = N("share-email-remail", this.Wc);
        U(this.i, "click", v(function () {
            vv(this);
            this.focus()
        }, this));
        this.e = N("share-email-recipients", this.D);
        this.b = N("share-email-note", this.D);
        this.g = N("share-email-preview-note", this.D);
        U(this.b, "keyup", v(this.Af, this))
    };

    function uv(a, b, c, d) {
        Ab(b, v(function () {
            var a = t("yt.sharing.ContactTools");
            a && a.createContactTools(this.e, n, c, d)
        }, a))
    }
    r.vb = function () {
        this.O && (this.Zc && vv(this), this.focus())
    };
    r.focus = function () {
        this.e.focus()
    };

    function vv(a) {
        a.Zc = p;
        a.e.value = "";
        a.b.value = "";
        a.g.innerHTML = "";
        Y(a.Wc);
        X(a.O)
    }
    r.Af = function () {
        var a = this.b.value,
            a = a.substring(0, 300),
            a = va(a),
            a = a.replace(/\n/g, "<br>");
        this.g.innerHTML = a
    };
    r.Bf = function (a) {
        a.preventDefault();
        var b = Rc("button", n, this.O)[0];
        b.disabled = m;
        var c = N("share-email-captcha", this.D),
            d = N("share-email-error", this.D),
            e = N("yt-alert-content", d);
        a = ve() + we(this.O.action);
        R(a, {
            format: "JSON",
            method: "POST",
            Wd: Kd(this.O),
            B: function () {
                this.Zc = m;
                X(this.Wc);
                Y(this.O);
                Y(d);
                Y(c)
            },
            onError: function (a, b) {
                b.captcha_html && (c.innerHTML = b.captcha_html, X(c));
                b.errors && (e.innerHTML = b.errors.join("<br>"), X(d))
            },
            da: function () {
                b.disabled = p
            },
            R: this
        })
    };

    function wv(a, b, c, d) {
        this.D = a;
        this.Qb = d || p;
        a = ve() + "/share_ajax";
        b = {
            action_get_embed: 1,
            video_id: b,
            list: c
        };
        this.Qb && (b.new_share = 1);
        R(a, {
            format: "JSON",
            G: b,
            B: function (a, b) {
                this.D.innerHTML = b.embed_html;
                this.dg = b.legacy_url;
                this.cg = b.legacy_code;
                this.cb = b.iframe_url;
                this.bg = b.iframe_code;
                this.rd = b.alternate_embed_urls;
                this.Xb();
                var c = kj.getInstance();
                this.bb && (this.bb.checked = !pj(0, sj.Be));
                this.xc.checked = pj(0, sj.Ae);
                this.ab && (this.ab.checked = pj(0, sj.Ce));
                a: if (c = c.get("ems"), this.Qb) {
                    "custom" == c && X(L("share-embed-customize"));
                    for (var d = 0; d < this.Xa.length; d++) {
                        var q = this.Xa[d];
                        if (q.value == c) {
                            q.selected = m;
                            Zh.getInstance().ib(this.Ja);
                            break a
                        }
                    }
                    this.Xa[0].selected = m;
                    Zh.getInstance().ib(this.Ja)
                } else(c in this.xa ? this.xa[c] : gb(this.xa)).select();
                xv(this);
                this.vb()
            },
            R: this
        })
    }
    r = wv.prototype;
    r.wb = 0;
    r.Lb = 0;
    r.Xb = function () {
        this.b = N("share-embed-code", this.D);
        U(this.b, "click", v(this.ig, this));
        this.Qb ? (yv(this), U(L("embed-with-playlist"), "click", v(this.K, this)), U(L("embed-with-playlist-current"), "click", v(this.A, this)), U(L("embed-with-playlist-first"), "click", v(this.C, this))) : zv(this);
        Av(this)
    };

    function zv(a) {
        var b = N("share-embed-size-list", a.D),
            c = M("share-embed-size-radio", b);
        a.xa = {};
        z(c, function (a) {
            K(a, "share-embed-size-radio-custom") || (a = new Bv(a), this.xa[a.name] = a)
        }, a);
        var c = gb(a.xa).width / gb(a.xa).height,
            d = N("share-embed-size-radio-custom", b),
            c = new Cv(d, c);
        a.xa[c.name] = c;
        a.j = c;
        W(b, "click", v(a.hh, a), "share-embed-size");
        b = N("share-embed-customize", b);
        U(b, "keyup", v(a.ih, a))
    }

    function yv(a) {
        a.Ja = L("embed-layout-options");
        a.Xa = Rc("option", n, a.Ja);
        var b = parseInt(T(a.Xa[0], "width"), 10),
            c = parseInt(T(a.Xa[0], "height"), 10);
        a.g = b / c;
        U(a.Ja, "change", v(function () {
            var a = this.Ja.options[Math.max(this.Ja.selectedIndex, 0)],
                a = !a ? n : a.value || a.text;
            kj.getInstance().set("ems", a);
            rj();
            xv(this);
            var b = L("share-embed-customize");
            "custom" == a ? X(b) : (Y(b), this.focus())
        }, a));
        b = L("share-embed-customize");
        a.i = N("share-embed-size-custom-width", b);
        a.e = N("share-embed-size-custom-height", b);
        U(a.i, "keyup",
            v(a.Dg, a));
        U(a.e, "keyup", v(a.Cg, a))
    }
    r.Dg = function () {
        this.wb = parseInt(this.i.value, 10);
        this.Lb = Math.round(this.wb / this.g) || 0;
        this.e.value = this.Lb + "";
        xv(this)
    };
    r.Cg = function () {
        this.Lb = parseInt(this.e.value, 10);
        this.wb = Math.round(this.Lb * this.g) || 0;
        this.wb.value = this.wb + "";
        xv(this)
    };

    function Av(a) {
        var b = {}, c = M("share-embed-option", a.D);
        z(c, function (a) {
            b[a.name] = a
        });
        a.bb = b["show-related"];
        a.bb && U(a.bb, "click", v(a.kh, a));
        a.xc = b["delayed-cookies"];
        U(a.xc, "click", v(a.jh, a));
        a.o = b["use-https"];
        U(a.o, "click", v(a.mh, a));
        a.ab = b["use-flash-code"] || n;
        a.ab && U(a.ab, "click", v(a.lh, a))
    }
    r.vb = function () {
        this.focus()
    };
    r.focus = function () {
        this.b && (this.b.focus(), this.b.select())
    };

    function xv(a) {
        var b = a.bg,
            c = a.cb;
        a.ab && a.ab.checked && (b = a.cg, c = a.dg);
        a.xc.checked && (c = c.replace("youtube.com", "youtube-nocookie.com"));
        a.o.checked && (c = c.split("//"), c[0] = "https:", c = c.join("//"));
        var d = {};
        a.bb && !a.bb.checked && (d.rel = 0);
        c = Ke(c, d);
        if (a.Qb) {
            var e = a.Ja.options[Math.max(a.Ja.selectedIndex, 0)];
            e ? "custom" == e.value ? d = {
                width: a.wb,
                height: a.Lb
            } : (d = parseInt(T(e, "width"), 10), e = parseInt(T(e, "height"), 10), d = {
                width: d,
                height: e
            }) : d = {
                width: 0,
                height: 0
            }
        } else d = Dv(a); if (!d.width || 200 > d.width) a.Qb ? (d = parseInt(T(a.Xa[0],
                "width"), 10), e = parseInt(T(a.Xa[0], "height"), 10), d = {
                width: d,
                height: e
            }) : d = gb(a.xa);
        b = b.replace(/__url__/g, va(c));
        b = b.replace(/__width__/g, d.width + "");
        b = b.replace(/__height__/g, d.height + "");
        b = va(b);
        b != a.b.innerHTML && (a.b.innerHTML = b)
    }
    function Dv(a) {
        a = kb(a.xa, function (a) {
            return a.b.checked
        });
        return !a ? {
            width: 0,
            height: 0
        } : {
            width: a.width,
            height: a.height
        }
    }
    r.kh = function () {
        var a = this.bb.checked;
        kj.getInstance();
        qj(sj.Be, !a);
        rj();
        xv(this)
    };
    r.jh = function () {
        var a = this.xc.checked;
        kj.getInstance();
        qj(sj.Ae, a);
        rj();
        xv(this)
    };
    r.mh = function () {
        xv(this)
    };
    r.lh = function () {
        var a = this.ab.checked;
        kj.getInstance();
        qj(sj.Ce, a);
        rj();
        xv(this)
    };
    r.ig = function () {
        this.focus()
    };
    r.hh = function (a) {
        a = N("share-embed-size-radio", a.currentTarget);
        a = this.xa[a.value];
        a.select();
        kj.getInstance().set("ems", a.name);
        rj();
        xv(this);
        a != this.j && this.focus()
    };
    r.ih = function () {
        xv(this)
    };

    function Bv(a) {
        this.name = a.value;
        this.b = a;
        this.width = parseInt(T(this.b, "width"), 10);
        this.height = parseInt(T(this.b, "height"), 10)
    }
    Bv.prototype.select = function () {
        this.b.checked = m;
        var a = wd(this.b, "li"),
            b = wd(a, "ul"),
            b = Rc("li", "selected", b);
        z(b, function (a) {
            J(a, "selected")
        });
        I(a, "selected")
    };

    function Cv(a, b) {
        Bv.call(this, a);
        this.i = b;
        var c = wd(a, "li");
        this.g = N("share-embed-size-custom-width", c);
        this.e = N("share-embed-size-custom-height", c);
        U(this.g, "keyup", v(this.j, this));
        U(this.e, "keyup", v(this.o, this))
    }
    y(Cv, Bv);
    Cv.prototype.j = function () {
        this.width = parseInt(this.g.value, 10);
        this.height = Math.round(this.width / this.i) || 0;
        this.e.value = this.height + ""
    };
    Cv.prototype.o = function () {
        this.height = parseInt(this.e.value, 10);
        this.width = Math.round(this.height * this.i) || 0;
        this.g.value = this.width + ""
    };
    wv.prototype.K = function (a) {
        a.target.checked ? (a = wd(L("embed-with-playlist-first"), "li"), a = K(a, "yt-uix-button-menu-item-selected") ? "first" : "default") : a = "nolist";
        this.cb = this.rd[a] || this.cb;
        xv(this)
    };
    wv.prototype.A = function () {
        this.cb = this.rd["default"] || this.cb;
        xv(this)
    };
    wv.prototype.C = function () {
        this.cb = this.rd.first || this.cb;
        xv(this)
    };

    function Ev(a, b, c, d, e, f, k, l) {
        this.D = a;
        this.$ = b || n;
        this.C = c || n;
        this.ba = p;
        this.A = k || p;
        this.ob = l || n;
        Fv(this, d)
    }
    var Gv = {
        FACEBOOK: "share_facebook",
        BLOGGER: "share_blogger",
        TWITTER: "share_twitter",
        GOOGLEPLUS: "share_gplus"
    };

    function Hv(a) {
        var b = ["h", "m", "s"],
            c = Ya(b);
        c.reverse();
        var d = {};
        a = a.toLowerCase().match(/\d+\s*[hms]?/g) || [];
        a = Ma(a, function (a) {
            var b = (a.match(/[hms]/) || [""])[0];
            return b ? (d[b] = parseInt(a.match(/\d+/)[0], 10), p) : m
        });
        for (a.reverse(); a.length && c.length;) {
            var e = c.shift();
            e in d || (d[e] = parseInt(a.shift(), 10))
        }
        if (a.length || 59 < d.s || 59 < d.m || 9 < d.h) return n;
        var f = "";
        z(b, function (a) {
            d[a] && (f += d[a] + a)
        });
        return f || n
    }

    function Fv(a, b) {
        var c = ve() + "/share_ajax",
            d = {
                action_get_share_box: 1,
                video_id: a.$,
                list: a.C,
                feature: a.ob
            };
        a.A && (d.new_share = 1);
        R(c, {
            format: "JSON",
            G: d,
            B: function (a, c) {
                this.D.innerHTML = c.share_html;
                this.oe = c.url_short;
                this.ne = c.url_long;
                this.Vg = c.lang;
                this.Xc = n;
                "session_index" in c && (this.Xc = c.session_index);
                this.Xb();
                b && b();
                this.vb()
            },
            R: a
        })
    }
    r = Ev.prototype;
    r.Xb = function () {
        var a = N("share-panel-show-url-options");
        U(a, "click", v(this.sg, this));
        a = N("share-panel-show-more");
        U(a, "click", v(this.ng, this));
        a = N("share-panel-services", this.D);
        U(a, "click", v(this.og, this));
        a = N("share-panel-embed", this.D);
        U(a, "click", v(this.lg, this));
        a = N("share-panel-email", this.D);
        U(a, "click", v(this.kg, this));
        (a = N("share-panel-hangout", this.D)) && U(a, "click", v(this.mg, this));
        this.i = N("share-panel-url", this.D);
        U(this.i, "click", v(this.tg, this));
        U(this.i, "focus", v(function () {
            I(this.i,
                "focused")
        }, this));
        U(this.i, "blur", v(function () {
            J(this.i, "focused")
        }, this));
        this.Ra = N("share-panel-long-url", this.D);
        this.Sa = N("share-panel-start-at-container", this.D);
        this.j = N("share-panel-start-at", this.D);
        this.g = N("share-panel-start-at-time", this.D);
        U(this.g, "change", v(this.jg, this));
        U(this.g, "click", v(this.rg, this));
        U(this.g, "focus", v(function () {
            I(this.g, "focused")
        }, this));
        U(this.g, "blur", v(function () {
            J(this.g, "focused")
        }, this));
        this.Aa = N("share-panel-hd", this.D);
        this.K = N("share-panel-url-options",
            this.D);
        U(this.K, "click", v(this.Rb, this));
        this.U = N("share-panel-services", this.D);
        this.ga = N("share-panel-buttons", this.D);
        a = N("share-panel-show-more", this.D);
        U(a, "click", v(this.qg, this));
        W(this.D, "click", v(this.pg, this), "share-service-button");
        this.A && (W(this.D, "click", v(this.ug, this), "share-service-expand-arrow"), this.o = N("share-panel-services-container", this.D), U(L("share-with-playlist"), "click", v(this.xg, this)), U(L("share-with-playlist-current"), "click", v(this.vg, this)), U(L("share-with-playlist-first"),
            "click", v(this.wg, this)))
    };
    r.ug = function (a) {
        var b = Q(a.target, "secondary");
        a = N("overlay", b);
        var c = K(b, "expanded"),
            d = "rtl" == document.body.getAttribute("dir") ? "right" : "left",
            e = c ? "0px" : Yf(b).width + "px";
        a.style[d] = e;
        a = c ? tj(a) : 0;
        D(function () {
            Nc(b, "expanded")
        }, a)
    };
    r.vb = function () {
        this.Rb();
        this.i && !K(this.i, "focused") && (this.i.focus(), this.i.select())
    };
    r.Rb = function () {
        if (!K(this.i, "focused")) {
            var a = this.oe;
            this.Ra && this.Ra.checked && (a = this.ne);
            var b = {};
            this.Aa && this.Aa.checked && (b.hd = 1);
            var c = !this.j.disabled && this.j.checked && Hv(this.g.value);
            c && (b.t = c);
            a = Ie(a, b);
            b = (b = B("CONVERSION_CONFIG_DICT")) ? xf(b.uid) : n;
            (b = (c = yf()) ? c : b && b.aid ? b.aid : n) && (a += Le("#", {
                aid: b
            }));
            this.i.value != a && (this.i.value = a)
        }
    };
    r.jg = function () {
        this.ba = m;
        this.j.checked = m;
        this.Rb()
    };
    r.rg = function () {
        this.j.checked = m;
        this.g.value.match(/[1-9]/) || (this.g.value = "")
    };
    r.tg = function () {
        this.i.select()
    };
    r.kg = function () {
        var a = Uh.getInstance();
        Wh(a, this.ga);
        Wh(a, this.K);
        Wh(a, this.U);
        this.e && Y(this.e);
        this.o && Y(this.o);
        this.b || (this.b = N("share-panel-email-container", this.D));
        Lg(this.b);
        !T(this.b, "disabled") && Kg(this.b) && (this.pa ? this.pa.vb() : this.pa = new tv(this.b, this.Xc, this.$, this.C, this.A));
        wf("share_mail")
    };
    r.mg = function () {
        var a = B("PLAYER_REFERENCE");
        a && a.pauseVideo && a.pauseVideo();
        var a = Ie("https://talkgadget.google.com/hangouts", {
            hl: this.Vg,
            authuser: this.Xc,
            gid: "youtube",
            gd: this.$,
            hs: 5
        }),
            b = window.screen.height,
            c = Math.min(0.9 * window.screen.width, 1E3),
            b = Math.min(0.9 * b, 800);
        Gf("HANGOUT", this.$ + "");
        bj(a, {
            width: c,
            height: b
        })
    };
    r.lg = function () {
        var a = Uh.getInstance();
        Wh(a, this.ga);
        Wh(a, this.K);
        Wh(a, this.U);
        this.b && Y(this.b);
        this.o && Y(this.o);
        this.e || (this.e = N("share-panel-embed-container", this.D));
        Lg(this.e);
        !T(this.e, "disabled") && Kg(this.e) && (this.Ba ? this.Ba.vb() : this.Ba = new wv(this.e, this.$, this.C, this.A));
        wf("share_embed")
    };
    r.pg = function (a) {
        a = T(a.currentTarget, "service-name") || "";
        (a = Gv[a]) && wf(a)
    };
    r.sg = function () {
        Wh(Uh.getInstance(), this.U);
        this.b && Y(this.b);
        this.e && Y(this.e)
    };
    r.ng = function () {
        Wh(Uh.getInstance(), this.K);
        this.b && Y(this.b);
        this.e && Y(this.e)
    };
    r.qg = function () {
        Iv(this)
    };
    r.og = function () {
        Iv(this);
        this.o && X(this.o)
    };

    function Iv(a) {
        a.b && Y(a.b);
        a.e && Y(a.e)
    }
    r.xg = function (a) {
        Jv(this);
        var b = p;
        a.target.checked && (b = wd(L("share-with-playlist-first"), "li"), b = K(b, "yt-uix-button-menu-item-selected"));
        Kv(this, a.target.checked, b)
    };

    function Lv(a) {
        L("share-with-playlist").checked = m;
        Jv(a)
    }

    function Jv(a) {
        var b = L("share-with-playlist").checked;
        a.j.disabled = b;
        a.g.disabled = b;
        a.A && a.Sa && Jg(a.Sa, !b)
    }
    r.vg = function () {
        Lv(this);
        Kv(this, m)
    };
    r.wg = function () {
        Lv(this);
        Kv(this, m, m)
    };

    function Kv(a, b, c) {
        var d = {
            action_get_share_urls: 1,
            video_id: a.$
        };
        b && (d.list = a.C);
        c && (d.use_first_video = m);
        R("share_ajax", {
            format: "JSON",
            G: d,
            B: function (a, b) {
                this.oe = b.url_short;
                this.ne = b.url_long;
                this.Rb();
                L("share-services-container").innerHTML = b.share_services_html
            },
            R: a
        })
    };

    function Mv(a) {
        var b = L("insight-optout-form");
        b && Re(b, {
            format: "XML",
            G: {
                opt_out: a
            },
            B: function () {
                var b = L("insight-public");
                Mc(L("insight-private"), "selected", a);
                Mc(b, "selected", !a)
            },
            da: function (a, b) {
                L("insight-optout-response").innerHTML = "error_message" in b ? b.error_message : ""
            }
        })
    }
    function Nv() {
        var a = L("stats-opt-out-chbox");
        a && U(a, "change", function () {
            Mv(!a.checked)
        })
    };

    function Ov(a, b, c) {
        c = c || {};
        Ye(v(Pv, s, a, b, c), c.onError)
    }
    function Pv(a, b, c) {
        var d = {};
        0 === b ? d.action_like_video = 1 : 1 === b ? d.action_dislike_video = 1 : d.action_indifferent_video = 1;
        d.video_id = a;
        d.plid = c.Qg;
        a = {
            screen: He({
                h: screen.height,
                w: screen.width,
                d: screen.colorDepth
            }),
            session_token: C("watch_actions_ajax")
        };
        c.ue && (a.station_id = c.ue);
        R("/watch_actions_ajax", {
            format: "XML",
            method: "POST",
            G: d,
            F: a,
            B: c.B,
            onError: c.onError,
            da: c.da
        });
        0 === b ? wf("like") : 1 === b && wf("dislike")
    };

    function Qv(a, b) {
        this.j = a;
        this.A = b;
        this.g = L("watch-like-dislike-buttons");
        this.i = "action-panel-details";
        var c = T(this.g, "vote-state"),
            c = parseInt(c, 10);
        isNaN(c) && (c = 2);
        fg(this.g, "vote-state");
        this.o = c;
        this.b = [];
        this.e = [];
        Rv(this);
        Sv(this, this.i);
        a: {
            c = Ge(window.location.hash).action;
            if ("share" == c) this.Md();
            else if ("flag" == c) c = L("watch7-secondary-actions"), yh(oh.getInstance(), c), c = Tv(this, L("action-panel-report")), I(c, "yt-uix-button-toggled"), Sv(this, "action-panel-report"), Uv("action-panel-report");
            else break a;
            L("watch7-headline").scrollIntoView()
        }
    }
    var Vv = {
        "action-panel-details": 1,
        "action-panel-share": 2,
        "action-panel-addto": 3,
        "action-panel-transcript": 4,
        "action-panel-stats": 5,
        "action-panel-report": 6,
        "action-panel-login": 7,
        "action-panel-ratings-disabled": 8,
        "action-panel-rental-required": 9,
        "action-panel-error": 10
    };

    function Uv(a) {
        switch (a) {
            case "action-panel-share":
                wf("share");
                break;
            case "action-panel-addto":
                wf("add_to_playlist")
        }
    }

    function Rv(a) {
        a.e.push(E("player-share", a.Md, a));
        a.e.push(E("player-sentiment", a.Vf, a));
        a.e.push(E("livestreaming-likes-updated", a.Xf, a));
        a.b.push(W(a.j, "click", v(a.Uf, a), "action-panel-trigger"));
        if (B("LOGGED_IN")) {
            var b = L("watch-dislike");
            a.b.push(U(L("watch-like"), "click", v(a.Tf, a)));
            a.b.push(U(b, "click", v(a.Sf, a)))
        }
        var c = L("donation-box");
        if (c) {
            var d = N("google-checkout-price", c);
            a.b.push(U(d, "change", function () {
                N("google-checkout-donate", c).disabled = 1 > d.selectedIndex
            }))
        }
        a.e.push(E("watch-video-liked",
            v(a.Wf, a)))
    }
    r = Qv.prototype;
    r.Tf = function () {
        var a = 0 == this.o ? 2 : 0;
        Wv(this) && Xv(this, a)
    };
    r.Sf = function () {
        var a = 1 == this.o ? 2 : 1;
        Wv(this) && Xv(this, a)
    };

    function Xv(a, b) {
        var c = B("VIDEO_ID");
        Yv(p);
        Ov(c, b, {
            Qg: B("PLAYBACK_ID"),
            ue: B("STATION_ID"),
            B: v(function (a, e) {
                0 == b ? (F("watch-video-liked"), Lc(this.g, "disliked", "liked")) : 1 == b ? (F("watch-video-disliked"), Lc(this.g, "liked", "disliked")) : J(this.g, "liked", "disliked");
                var f = L("watch-like"),
                    k;
                if (k = 0 == b ? T(f, "unlike-tooltip") : T(f, "like-tooltip")) f.title = k;
                this.o = b;
                0 == b && "True" == e.show_feed_privacy_dialog && F("SHOW-LIKE-DIALOG", c)
            }, a),
            onError: v(function () {
                Zv(this, "action-panel-error")
            }, a),
            da: v(function () {
                Yv(m)
            },
                a)
        })
    }
    function Yv(a) {
        var b = L("watch-like-dislike-buttons");
        D(function () {
            pg(b, a)
        }, 0)
    }
    r.Wf = function () {
        var a = L("watch7-secondary-actions");
        yh(oh.getInstance(), a);
        a = Tv(this, L("action-panel-share"));
        I(a, "yt-uix-button-toggled");
        Ub || Sv(this, "action-panel-share")
    };
    r.Md = function () {
        var a = L("watch7-secondary-actions");
        yh(oh.getInstance(), a);
        a = Tv(this, L("action-panel-share"));
        I(a, "yt-uix-button-toggled");
        Sv(this, "action-panel-share");
        Uv("action-panel-share")
    };
    r.Vf = function (a) {
        Wv(this) && Xv(this, a)
    };

    function Wv(a) {
        return !B("ALLOW_RATINGS") ? (Zv(a, "action-panel-ratings-disabled"), p) : !B("LOGGED_IN") ? (Zv(a, "action-panel-login"), p) : !B("YPC_CAN_RATE_VIDEO") ? (Zv(a, "action-panel-rental-required"), p) : B("YPC_SHOW_VPPA_CONFIRM_RATING") && !confirm(Sb("VPPA_CONFIRM")) ? p : m
    }
    r.Uf = function (a) {
        a = T(a.currentTarget, "trigger-for");
        Sv(this, a);
        Uv(a)
    };

    function Sv(a, b) {
        if ("action-panel-none" != b) {
            var c = L(b),
                d = !! T(c, "auth-required"),
                c = !! T(c, "panel-loaded");
            if (d && !B("LOGGED_IN")) Zv(a, "action-panel-login");
            else if (c) Zv(a, b);
            else switch (b) {
                    case "action-panel-details":
                        d = L("action-panel-details");
                        $v(a);
                        S(d, "panel-loaded", "true");
                        Zv(a, "action-panel-details");
                        break;
                    case "action-panel-share":
                        aw(a);
                        break;
                    case "action-panel-addto":
                        d = L("action-panel-addto");
                        new Tn(d, B("VIDEO_ID"), ca);
                        S(d, "true", "panel-loaded");
                        Zv(a, "action-panel-addto");
                        break;
                    case "action-panel-transcript":
                        bw(a);
                        break;
                    case "action-panel-stats":
                        cw(a);
                        break;
                    case "action-panel-report":
                        dw(a)
            }
        }
    }
    function $v(a) {
        var b = N("yt-uix-expander", L("action-panel-details"));
        b && (a.b.push(U(L("watch-description-content"), "click", function () {
            if (K(b, "yt-uix-expander-collapsed")) {
                var a = Uh.getInstance(),
                    d = a.Y(b);
                d && (J(d, Z(a, "collapsed")), a.oa(d, "expander-action"))
            }
        })), K(b, "yt-uix-expander-collapsed") && a.b.push(xg(b, "click", function () {
            var a = L("watch-source-videos-list");
            a && Fk(a)
        })))
    }

    function aw(a) {
        var b = Ak(),
            c = Bk(),
            d = L("action-panel-share"),
            e = new Ev(L("watch-actions-share-panel"), b, c, function () {
                Y("watch-actions-share-loading")
            }, 0, 0, m),
            f = Ck(),
            k = Pb(function () {
                var a = Kg(d);
                if (!f || !a) window.clearInterval(k);
                else {
                    var a = f.getCurrentTime(),
                        b = Math.floor(a / 3600),
                        c = Math.floor(a % 3600 % 60),
                        a = (0 < b ? b + ":" : "") + Fa(Math.floor(a % 3600 / 60), 0 < b ? 2 : 1) + ":" + Fa(c, 2);
                    e.g && (!K(e.g, "focused") && !e.ba) && (e.g.value = a, e.Rb())
                }
            }, 1E3);
        S(d, "panel-loaded", "true");
        Zv(a, "action-panel-share")
    }

    function cw(a) {
        var b = L("action-panel-stats"),
            c = v(function () {
                Zv(this, "action-panel-error")
            }, a);
        Ek(function (a, e) {
            e ? (b.innerHTML = a, Nv()) : c()
        });
        S(b, "panel-loaded", "true");
        Zv(a, "action-panel-stats")
    }
    function dw(a) {
        var b, c = p,
            d = p,
            e = L("action-panel-report"),
            f = v(function () {
                Zv(this, "action-panel-error")
            }, a);
        Bb(B("REPORTVIDEO_CSS"));
        Ab(B("REPORTVIDEO_JS"), v(function () {
            c = m;
            d && c && ew(e, b)
        }, a));
        Dk(v(function (a, l) {
            l ? (d = m, b = a, d && c && ew(e, b)) : f()
        }, a));
        S(e, "panel-loaded", "true");
        Zv(a, "action-panel-report")
    }

    function ew(a, b) {
        a.innerHTML = b;
        t("yt.www.report.reportvideo.init")()
    }
    function bw(a) {
        var b = L("action-panel-transcript");
        t("yt.www.watch.transcript.open")(function () {
            Y("watch-actions-transcript-loading");
            X(L("watch-actions-transcript"))
        });
        S(b, "panel-loaded", "true");
        Zv(a, "action-panel-transcript")
    }

    function Zv(a, b) {
        var c = Vv[a.i],
            d = Vv[b],
            e = L(a.i),
            f = L(b),
            k = a.A;
        if (d == c) J(k, "action-panel-transition"), J(e, "action-panel-center", "action-panel-left", "action-panel-right"), X(e);
        else {
            a.i = b;
            X(e);
            k.style.height = k.clientHeight + "px";
            I(k, "action-panel-transition");
            if (d > c) var l = "action-panel-right",
            q = "action-panel-left";
            else l = "action-panel-left", q = "action-panel-right";
            I(e, "action-panel-center");
            I(f, l);
            X(f);
            D(function () {
                J(e, "action-panel-center");
                I(e, q);
                J(f, l);
                I(f, "action-panel-center");
                D(function () {
                    Y(e);
                    J(e,
                        q);
                    J(f, "action-panel-center");
                    J(k, "action-panel-transition");
                    k.style.height = ""
                }, tj(f))
            }, 0)
        }
    }
    function Tv(a, b) {
        var c = M("action-panel-trigger", a.j);
        return Qa(c, function (a) {
            a = T(a, "trigger-for");
            return b.id == a
        })
    }
    r.Xf = function (a, b, c, d) {
        var e = L("watch7-views-info"),
            f = N("likes-count", e);
        f && pd(f, a);
        (a = N("dislikes-count", e)) && pd(a, b);
        if (b = N("video-extras-sparkbar-likes", e)) b.style.width = c + "%";
        if (c = N("video-extras-sparkbar-dislikes", e)) c.style.width = d + "%"
    };
    var fw, gw, hw = "pyv-feed-item-headline-dest-url pyv-feed-item-thumb-dest-url pyv-shelf-headline-dest-url pyv-shelf-thumb-dest-url pyv-medium-shelf-headline-dest-url pyv-medium-shelf-thumb-dest-url".split(" "),
        iw = "",
        jw = 0;

    function kw(a, b, c, d) {
        var e = Qa(b.media_template_data, function (a) {
            return !!a.imageUrl
        });
        e && (a = {
            video_id: e.videoId,
            ad_type: a,
            headline: Ba(b.line1),
            image_url: e.imageUrl,
            description1: Ba(b.line2),
            description2: Ba(b.line3),
            channel_title: e.channelName
        }, iw = Ba(b.url), sa(b.creative_view_url == n ? "" : String(b.creative_view_url)) || (fw = Ba(b.creative_view_url)), Ue("/pyv?" + He(a), {
            method: "GET",
            update: c,
            onComplete: d
        }))
    }

    function lw(a) {
        if (0 == a.length) mw(), B("PYV_TRACK_RELATED_CTR") && (nw("watch-related", p), nw("watch-channel-videos-panel", p));
        else {
            var b = L("watch-channel-videos-panel");
            b && !B("IS_BRANDED_WATCH") && I(b, "yt-uix-expander-collapsed");
            kw("watch_related", a[0], n, function (a) {
                a = Ve(Se(a.responseXML), "html_content") || "";
                var b = L(window.pyv_related_box_id || "watch-related");
                b && (0 != b.innerHTML.indexOf(a) && (b.insertBefore(ad(a), b.firstChild), B("PYV_TRACK_RELATED_CTR") && (nw("watch-related", m), nw("watch-channel-videos-panel",
                    m))), (a = L("pyv-watch-related-dest-url")) && a.setAttribute("href", iw), vf(fw))
            })
        }
    }
    function mw() {
        var a = M("related-video-featured");
        z(a, function (a) {
            X(a)
        })
    }
    function ow() {
        var a = M("related-video-featured");
        2 == a.length ? K(a[0], "related-video-featured-booster") ? X(a[1]) : X(a[0]) : z(a, function (a) {
            X(a)
        })
    }

    function pw(a) {
        z(a, function (a) {
            var c = a.media_template_data[0];
            a.line1 = Ba(a.line1);
            a.line2 = Ba(a.line2);
            a.line3 = Ba(a.line3);
            a.url = Ba(a.url);
            c.imageUrl = Ba(c.imageUrl);
            c.channelName = Ba(c.channelName);
            c.imageUrl && -1 != c.imageUrl.indexOf("/vi/") && (c.imageUrl = c.imageUrl.replace(/default\.jpg/, "hqdefault.jpg"), c.imageUrl = c.imageUrl.replace(/\/([1-9])\.jpg/, "/hq$1.jpg"));
            var d = a.duration / 1E3,
                c = Math.floor(d / 3600),
                e = d % 3600,
                d = Math.floor(e / 60),
                e = e % 60,
                c = c ? ra("%s:%s:%s", c.toString(), Fa(d, 2), Fa(e, 2)) : ra("%s:%s", d.toString(),
                    Fa(e, 2));
            a.duration = c
        })
    }
    function qw(a) {
        gw = Sq();
        var b = L("pyv-afc-client-ads");
        z(a, function (a) {
            var d = document.createElement("div"),
                e = a.media_template_data[0];
            d.innerHTML = Tq(gw, {
                title: a.line1,
                second_line: a.line2,
                third_line: a.line3,
                url: a.url,
                views: a.view_count,
                length_seconds: a.duration,
                video_id: e.videoId,
                channel_name: e.channelName,
                thumbnail_url: e.imageUrl
            }, n, m);
            b.appendChild(d)
        })
    }

    function nw(a, b) {
        var c = L(a);
        c && (c = Rc("li", "video-list-item", c), z(c, function (a, c) {
            var f = Rc("a", n, a);
            z(f, function (a) {
                var d = a.getAttribute("href");
                d && unescape(d).match(/\/watch(\?|#!)v=/) && (a.href = b ? a.href + ("&pvpos=" + c) : a.href + ("&pvnpos=" + c))
            })
        }))
    }

    function rw(a, b) {
        b && (jw = w());
        var c = window.location.href;
        c.indexOf("#") == c.length - 1 && lc && (window.location.hash = "#!");
        var c = document.body,
            d = Oc(c),
            e = [];
        e.push("<!DOCTYPE html>");
        e.push("<html><head>", a, "</head><body>", "", "</body></html>");
        d = d.ji("iframe", {
            frameborder: 0,
            style: "border:0;vertical-align:bottom;display: none",
            src: 'javascript:""'
        });
        c.appendChild(d);
        c = e.join("");
        e = d.contentDocument || d.contentWindow.document;
        e.open();
        e.write(c);
        e.close()
    };

    function sw() {
        var a = B("ADS_DATA");
        if (a) {
            tw(a);
            a.show_pyv ? rw("<script>var pyvOptions = " + a.pyv_vars.iframe_json + '; for (var key in pyvOptions) { window[key] = pyvOptions[key]; } window["google_ad_request_done"] = parent.yt.www.ads.pyv.pyvWatchAfcWithPpvCallback; \x3c/script><script src="//pagead2.googlesyndication.com/pagead/show_ads.js">\x3c/script>', a.pyv_vars.measure_latency) : mw();
            a.use_gut && (zb("//www.googletagservices.com/tag/js/gpt.js"), Ab("//www.googletagservices.com/tag/js/gpt.js", function () {
                uw(a.gut_vars.tag)
            }));
            if (a.show_afv || a.show_afc) zb("//pagead2.googlesyndication.com/pagead/show_companion_ad.js"), xb("//pagead2.googlesyndication.com/pagead/show_companion_ad.js", h), xb("//www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22ads%22%2C%22version%22%3A%221%22%2C%22callback%22%3A%22(function()%7B%7D)%22%2C%22packages%22%3A%5B%22content%22%5D%7D%5D%7D", h);
            a.show_afc && vw(a)
        }
    }
    function tw(a) {
        ww = [];
        if ("afv_vars" in a) for (var b in a.afv_vars) window[b] = a.afv_vars[b], ww.push(b)
    }

    function uw(a) {
        googletag && (xw = googletag.defineSlot(a, [
            [300, 250],
            [300, 60]
        ], "yt-gut-content"), xw.set("ad_type", "flash"), xw.addService(googletag.companionAds()), googletag.enableServices(), a = xw.getSizes(), yw = a[0], zw = a[1])
    }
    function Aw(a, b) {
        a || (a = "");
        b || (b = p);
        var c = L("watch-channel-brand-div");
        c && Mc(c, "collapsible", b);
        if (c = L("google_companion_ad_div")) c.innerHTML = a;
        Bw()
    }

    function Cw(a, b) {
        var c = Math.round(1E4 * Math.random());
        return ['<iframe src="', a, '" name="ifr_300x', b, "ad", c, '" id="ifr_300x', b, "ad", c, '" width="300" height="', b, '" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'].join("")
    }
    function Dw(a) {
        return !!a.match("/subscribe_widget.*render=video_wall_companion")
    }
    function Ew(a) {
        a = a.replace(";dc_seed=", ";kmyd=watch-channel-brand-div;dc_seed=");
        var b = Cw(a, 250);
        a = Dw(a);
        Aw(b, a)
    }

    function Fw(a) {
        a = a.replace(";dc_seed=", ";kmyd=watch-longform-ad;dc_seed=");
        var b = Cw(a, 60);
        a = Dw(a);
        Aw(b, a)
    }

    function Gw(a, b) {
        var c = 250;
        "video" == a && (c = 60);
        var d = decodeURIComponent(b);
        Aw(['<iframe name="fw_ad" id="fw_ad" ', 'width="300" height="' + c + '" ', 'marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'].join(""));
        var e = L("fw_ad");
        if (e) {
            var e = e.contentWindow ? e.contentWindow : e.contentDocument.document ? e.contentDocument.document : e.contentDocument,
                f = navigator.userAgent.toLowerCase(),
                c = -1 != f.indexOf("msie"),
                f = -1 != f.indexOf("opera");
            e.document.open();
            e.document.write(d);
            c || f ? D(function () {
                e.document.close()
            }, 7500) : e.document.close()
        }
    }
    function Bw() {
        F("watchads-adLoad")
    }
    function Hw(a) {
        window.google_ad_output = "html";
        a ? (window.google_ad_height = "60", window.google_ad_format = "300x60_as") : (window.google_ad_height = "250", window.google_ad_format = "300x250_as");
        window.google_container_id = "google_companion_ad_div"
    }
    function Iw() {}
    function Jw() {
        Bw()
    }

    function vw(a) {
        var b = t("google.ads.Ad");
        b ? new b(a.afv_vars.google_ad_client, "google_companion_ad_div", a.afc_vars) : Kw = D(function () {
            vw(a)
        }, 200)
    }
    var ww = n,
        Kw = 0,
        xw = n,
        yw = n,
        zw = n;

    function Lw() {
        this.b = [];
        this.g = 0;
        this.e = n;
        this.b.push(E("page-init", this.Jf, this));
        this.b.push(E("page-resize", this.Kf, this));
        this.b.push(E("player-state-change", this.Mf, this));
        this.b.push(E("player-resize", this.Lf, this))
    }
    r = Lw.prototype;
    r.Jf = function (a) {
        this.e = a;
        this.Hc()
    };
    r.Kf = function (a) {
        this.e = a;
        this.Hc()
    };
    r.Mf = function (a) {
        1 == a && Mw()
    };
    r.Lf = function (a) {
        Nw(this, a)
    };

    function Nw(a, b) {
        var c = !! b,
            d = L("watch7-container"),
            e = L("watch7-sidebar"),
            f = tj(e);
        if (c) c = f, I(d, "watch-wide"), K(d, "watch-playlist") && I(d, "watch-playlist-collapsed"), a.g = D(v(a.Hc, a), c);
        else if (c = f / 2, a.Hc("small"), a.g = D(function () {
            J(d, "watch-wide");
            K(d, "watch-playlist") && J(d, "watch-playlist-collapsed")
        }, c), Oj(e), e = L("watch7-playlist-tray-container")) e = tj(e), D(kk, e + c)
    }
    r.Hc = function (a) {
        var b = L("watch7-container"),
            c = K(b, "watch-wide"),
            d = this.e;
        !c || "small" == a ? J(b, "watch-medium", "watch-large") : (c = !! B("ENABLE_AUTO_LARGE"), d = B("GUIDE_ENABLED") ? 1540 <= d.width && 1040 <= d.height : 1700 <= d.width && 1040 <= d.height, c && (d || "large" == a) ? Lc(b, "watch-medium", "watch-large") : Lc(b, "watch-large", "watch-medium"));
        Mw()
    };

    function Mw() {
        if (B("ENABLE_ASPECT_RATIO")) {
            var a = L("watch7-container"),
                b = L("player-api");
            if (!K(a, "watch-medium") && !K(a, "watch-large")) b.style.height = "";
            else {
                var c;
                c = B("PLAYER_REFERENCE");
                !c || !c.getVideoAspectRatio ? c = 0 : (c = parseFloat(c.getVideoAspectRatio()), c = isNaN(c) || !isFinite(c) ? 0 : c);
                if (1.3 > c) b.style.height = "";
                else {
                    2.8 < c && (c = 2.8);
                    var d;
                    d = document.defaultView ? document.defaultView.getComputedStyle(b, n) : document.parentWindow.getComputedStyle(b, n);
                    if (d = parseInt(d.width, 10)) {
                        var e = K(a, "watch-autohide"),
                            a = K(a, "watch-multicamera") ? e ? 83 : 110 : e ? 3 : 30;
                        b.style.height = Math.floor(d / c + a) + "px"
                    } else b.style.height = ""
                }
            }
        }
    };
    var Ow, Pw, Qw;

    function Rw(a) {
        if (Ow && !(3 <= Pw)) {
            var b = M("video-list-item", L("watch7-playlist-tray"));
            if (b && b.length) {
                var c = ((Ra(b, function (a) {
                    return K(a, "playlist-bar-item-playing")
                }) || 0) + 1 + a) % b.length;
                (b = kd(b[c])) && b.href && t("spf.preload")(b.href, qa(Sw, Rw, a + 1))
            }
        }
    }
    function Tw(a) {
        if (Ow && !(3 <= Pw)) {
            var b = M("video-list-item");
            b && b.length > a && ((b = kd(b[a])) && b.href && !K(b, "related-channel") && !K(b, "video-list-item-link") ? t("spf.preload")(b.href, qa(Sw, Tw, a + 1)) : Qw = D(qa(Tw, a + 1), 500))
        }
    }

    function Sw(a, b, c, d) {
        Pw++;
        1 == Pw && d.swfcfg && (c = d.swfcfg.args, (d = Su) && (d.preloadVideoByPlayerVars && c) && d.preloadVideoByPlayerVars(c));
        Qw = D(qa(a, b), 500)
    };

    function Uw() {
        var a = L("watch7-action-buttons"),
            b = L("watch7-action-panels");
        Kh = n;
        a && b && (Kh = new Qv(a, b));
        Lh = new Lw;
        var a = L("watch-context-container"),
            b = L("appbar-context-container"),
            c;
        c = (c = B("VIDEO_ID")) ? rf("context-" + c, Sh) : n;
        var d;
        c ? window.yt.spf && c.propagated && 0 < a.children.length ? (c.open && S(a, "start-open", "true"), dr(c.clickindex), d = p) : d = m : d = p;
        d && (Uq(c, a, b), br(a, c.open, b));
        Xp();
        U(document, "keypress", Rj);
        sw();
        Sj();
        if (B("BRANDED_BACKGROUND_IMAGE") || B("BRANDED_BACKGROUND_COLOR")) I(L("guide-container"),
                "branded"), a = L("player"), b = B("BRANDED_BACKGROUND_IMAGE"), c = B("BRANDED_BACKGROUND_COLOR"), b && (a.style.background = "transparent url(" + b + ") no-repeat center top", K(document.body, "site-left-aligned") && (a.style.backgroundPosition = "left top")), c && (a.style.backgroundColor = c);
        window.yt.spf && B("WATCH_SPF_PRELOAD") && (Ow = m, Pw = 0, Qw = L("watch7-playlist-data") ? D(qa(Rw, 0), 5E3) : D(qa(Tw, 0), 5E3));
        Ub && (!document.documentMode || 8 > document.documentMode) && Vw.push(W(document.body, "click", Ww, "video-thumb"))
    }

    function Xw() {
        if (Kh) {
            var a = Kh;
            V(a.b);
            a.b = [];
            Wb(a.e);
            a.e = [];
            Kh = n
        }
        a = Lh;
        Qb(a.g);
        Wb(a.b);
        a.b = [];
        Lh = n;
        Bg(document, "keypress", Yp);
        Bg(document, "click", Zp);
        Wp = -2;
        Bg(document, "keypress", Rj);
        Qb(Kw);
        zw = yw = xw = n;
        if (ww) {
            for (a = ww.length - 1; 0 <= a; a--) {
                var b = ww[a];
                Ub ? window[b] = h : delete window[b]
            }
            ww = []
        }
        if (id = hd) id.id = "";
        V(Tj);
        Tj = [];
        Wb(Zj);
        Zj = [];
        ik = n;
        mk = rk = yk = p;
        hd = n;
        sk && (Qb(sk), sk = n);
        J(L("guide-container"), "branded");
        L("player").style.background = "";
        Ow = p;
        Qb(Qw);
        V(Vw);
        Vw = []
    }

    function Ww(a) {
        wd(a.target, "BUTTON") || a.currentTarget.click()
    }
    var Vw = [];
    var Yw = ["ypc-container", "ypc-unsubscribe-link", "ypc-rap-overlay-link", "ypc-delayedloader-target"];

    function Zw() {
        if (B("YPC_LOADER_ENABLED")) {
            for (var a = 0; a < Yw.length; a++) if (N(Yw[a])) {
                    $w();
                    break
                }
            E("ypc-delayedloader-load", $w)
        }
    }
    function $w(a) {
        function b() {
            (d -= 1) || c()
        }
        function c() {
            z(B("YPC_LOADER_CALLBACKS"), function (a) {
                (a = t(a)) && a()
            });
            a && a()
        }
        Bb(B("YPC_LOADER_CSS"));
        var d = 2,
            e = B("YPC_LOADER_CONFIGS");
        xb(B("YPC_LOADER_JS"), b);
        R(e, {
            B: function (a, c) {
                Rb(c.templates);
                b()
            }
        })
    };

    function ax(a, b, c) {
        this.g = T(a, "id");
        this.target = a;
        this.o = c;
        this.b = p
    }
    ax.prototype.show = function () {
        this.b = p;
        D(v(this.i, this), 1E3);
        !this.e && !this.o && this.get()
    };
    ax.prototype.i = function () {
        this.b = m;
        var a = ci.getInstance(),
            b = a.Y(this.o || this.target);
        if (wd(b, "body")) {
            var c = Fh(a, b).innerHTML || this.e;
            if (c) {
                var b = this.target,
                    d = a.Y(b);
                if (d) {
                    var e = Fh(a, d);
                    e && (e.innerHTML = c, K(d, Z(a, "active")) && (c = Dh(a, b, d), Eh(a, b, c), X(c)))
                }
            }
        }
    };
    ax.prototype.get = function () {
        var a = {
            method: "POST",
            da: v(this.j, this),
            F: {
                external_channel_id: this.g,
                session_token: C("channel_details_ajax")
            }
        };
        R("/channel_details_ajax", a)
    };
    ax.prototype.j = function (a, b) {
        b.html && (this.e = b.html, this.b && this.i())
    };
    var bx = [];

    function cx(a, b, c) {
        a.timeOfStartCall = (new Date).getTime();
        var d = c || s,
            e = a.serverUri || "//www.google.com/tools/feedback",
            f = d.GOOGLE_FEEDBACK_START;
        /iphone|ipad|ipod|android|blackberry|mini|windows\sce|windows\sphone|palm/i.test(navigator.userAgent) && (a.mobileWindow = window.open(""));
        d.GOOGLE_FEEDBACK_START_ARGUMENTS = arguments;
        f ? f.apply(d, arguments) : (d = d.document, f = d.createElement("script"), f.src = e + "/load.js", d.body.appendChild(f))
    };
    var dx = p,
        ex = "";

    function fx(a) {
        a = a.match(/[\d]+/g);
        a.length = 3;
        return a.join(".")
    }
    if (navigator.plugins && navigator.plugins.length) {
        var gx = navigator.plugins["Shockwave Flash"];
        gx && (dx = m, gx.description && (ex = fx(gx.description)));
        navigator.plugins["Shockwave Flash 2.0"] && (dx = m, ex = "2.0.0.11")
    } else if (navigator.mimeTypes && navigator.mimeTypes.length) {
        var hx = navigator.mimeTypes["application/x-shockwave-flash"];
        (dx = hx && hx.enabledPlugin) && (ex = fx(hx.enabledPlugin.description))
    } else try {
            var ix = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),
                dx = m,
                ex = fx(ix.GetVariable("$version"))
    } catch (jx) {
        try {
            ix =
                new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"), dx = m, ex = "6.0.21"
        } catch (kx) {
            try {
                ix = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"), dx = m, ex = fx(ix.GetVariable("$version"))
            } catch (lx) {}
        }
    }
    var mx = ex;

    function nx(a) {
        return (a = a.exec(fc())) ? a[1] : ""
    }
    var ox = function () {
        if (Fr) return nx(/Firefox\/([0-9.]+)/);
        if (G || jc) return wc;
        if (Kr) return nx(/Chrome\/([0-9.]+)/);
        if (Lr) return nx(/Version\/([0-9.]+)/);
        if (Hr || Ir) {
            var a = /Version\/(\S+).*Mobile\/(\S+)/.exec(fc());
            if (a) return a[1] + "." + a[2]
        } else {
            if (Jr) return (a = nx(/Android\s+([0-9.]+)/)) ? a : nx(/Version\/([0-9.]+)/);
            if (Gr) return nx(/Camino\/([0-9.]+)/)
        }
        return ""
    }();
    var px = {}, qx = [];

    function rx() {
        qx.push(E("player-ad-start", sx))
    }
    function tx() {
        Wb(qx);
        qx = []
    }
    function ux() {
        (G ? 0 <= Ga(ox, "7") && 0 <= Ga(mx, "9") : Fr ? 0 <= Ga(ox, "3.5") : Lr ? 0 <= Ga(ox, "5") : Kr) || Y("reportbug")
    }
    function sx() {
        var a = L("movie_player");
        a && a.currentAdInformation && (a = a.currentAdInformation(), a.adIds && (px.ad_ids = a.adIds.join()), a.adSystems && (px.ad_systems = a.adSystems.join()))
    };

    function vx() {
        wx.push(U(window, "resize", xx));
        wx.push(U(window, "scroll", yx));
        kj.getInstance();
        var a = 1 < window.devicePixelRatio;
        pj(0, sj.Ye) != a && (qj(sj.Ye, a), rj());
        D(zx, 0)
    }
    function Ax() {
        Qb(Bx);
        Cx = Bx = 0;
        V(wx);
        wx = []
    }
    function zx() {
        var a = Uc(window),
            b = Wc(document);
        F("page-init", a, b)
    }
    function xx() {
        Qb(Bx);
        Bx = D(function () {
            F("page-resize", Uc(window))
        }, 200)
    }
    function yx() {
        var a = Wc(document);
        50 <= Math.abs(Cx - a.y) && F("page-scroll", a)
    }
    var wx = [],
        Bx = 0,
        Cx = 0;
    var Dx;

    function Ex(a) {
        var b = N("feed-load-more-container");
        b && K(b, "scrolldetect") && J(b, "scrolldetect");
        var b = "yt-picker-" + a,
            c = L(b + "-button");
        Fx(L(b + "-footer"), a, p, p, m);
        Sf(c)
    }
    function Fx(a, b, c, d, e) {
        c || (Dx && Dx != a && Y(Dx), Dx = a, e ? X(a) : Og(a));
        d ? N("yt-close", a).focus() : (c = {}, c["action_" + b] = 1, c.base_url = B("CURRENT_URL"), R("/picker_ajax", {
            format: "JSON",
            method: "GET",
            G: c,
            B: v(Gx, n, a),
            onError: function () {
                Y(a)
            }
        }))
    }

    function Gx(a, b, c) {
        !c || !c.html ? Y(a) : (S(a, "loaded", 1), a.innerHTML = c.html, b = N("yt-picker-content", a), c = Rc(n, "yt-picker-section", b), z(c, v(Hx, n, Math.floor(b.offsetWidth / 180))), Sf(a), N("yt-close", a).focus())
    }

    function Hx(a, b) {
        for (var c = Rc(n, "yt-picker-item", b), d = Math.ceil(c.length / a), e, f = document.createElement("div"), k = 0; k < a; k++) {
            e = document.createElement("div");
            e.className = "yt-picker-grid";
            for (var l = d * k; l < d * (k + 1); l++) c[l] && e.appendChild(c[l]);
            e.children.length && f.appendChild(e)
        }
        b.innerHTML = f.innerHTML
    };
    var Ix = [];

    function Jx() {
        for (var a = 0; a < document.forms.length; a++) {
            for (var b = p, c = 0; c < Ix.length; c++) document.forms[a].name == Ix[c] && (b = m);
            c = document.forms[a];
            if ("post" == c.method.toLowerCase() && b == p) {
                for (var b = p, d = 0; d < c.elements.length; d++) c.elements[d].name == B("XSRF_FIELD_NAME") && (b = m);
                b || (b = h, b = B("XSRF_TOKEN"), d = document.createElement("input"), d.setAttribute("name", B("XSRF_FIELD_NAME")), d.setAttribute("type", "hidden"), d.setAttribute("value", b), c.appendChild(d))
            }
        }
    };
    x("yt.www.watch.ads.setAdId", function (a) {
        window.ad_debug = a
    });
    x("yt.www.watch.ads.setCompanion", Aw);
    x("yt.www.watch.ads.showForcedMpu", function (a) {
        var b = Cw(a, 250);
        a = Dw(a);
        Aw(b, a)
    });
    x("yt.www.watch.ads.createGutSlot", uw);
    x("yt.www.watch.ads.handleMoveGutCompanion", function () {
        var a = L("google_companion_ad_div"),
            b = L("yt-gut-content");
        b ? b.innerHTML = "" : (b = document.createElement("div"), b.id = "yt-gut-content");
        a && (a.innerHTML = "", a.appendChild(b));
        Bw()
    });
    x("yt.www.watch.ads.setGutSlotSizes", function (a, b) {
        if (xw) {
            var c = xw.getSizes();
            Ua(c);
            b && c.push(yw);
            a && c.push(zw)
        }
    });
    x("yt.www.watch.ads.handleSetCompanion", Ew);
    x("yt.www.watch.ads.handleSetCompanionForInstream", Fw);
    x("yt.www.watch.ads.handleSetCompanionForFreewheel", Gw);
    x("yt.www.watch.ads.handleHideCompanion", Aw);
    x("yt.www.watch.ads.handleHideCompanionForInstream", Aw);
    x("yt.www.watch.ads.handleCloseMpuCompanion", Aw);
    x("yt.www.watch.ads.handleSetAfvCompanionVars", Hw);
    x("yt.www.watch.ads.handleShowAfvCompanionAdDiv", Iw);
    x("yt.www.watch.ads.handleHideAfvInstreamCompanionAdDiv", Jw);
    x("yt.www.watch.ads.AD_LOAD_TOPIC", "watchads-adLoad");
    x("yt.www.ads.pyv.pyvWatchAfcWithPpvCallback", function (a) {
        if (jw) {
            var b = w() - jw;
            Df("pyv_watch_server_time", "rttms=" + b.toString(), h)
        }
        lw(a);
        0 < a.length && ow()
    });
    x("yt.www.ads.pyv.pyvWatchAfcCallback", lw);
    x("yt.www.ads.pyv.pyvSearchTopAfcCallback", function (a) {
        var b = L("pyv-top-ads");
        !a.length || !b ? Mg("results") : (pw(a), L("pyv-afc-ads-template") && (qw(a), b && Mg(b)), Mg("results"), yj().tick.resultspostdclk = w())
    });
    x("yt.www.ads.pyv.pyvHomeAfcCallback", function (a) {
        var b = "feed",
            c = "feed-pyv-container",
            d = L("medium-shelf-pyv-container"),
            e = L("shelf-pyv-container");
        L("feed-pyv-container") ? (b = "feed", c = "feed-pyv-container") : d ? (b = "medium_shelf", c = "medium-shelf-pyv-container") : e && (b = "shelf", c = "shelf-pyv-container");
        var f = L(c);
        if (!f || 0 == a.length) if ("feed" == b || "shelf" == b || "medium_shelf" == b) {
                fd(f);
                return
            }
        kw(b, a[0], f, function () {
            z(hw, function (a) {
                (a = document.getElementById(a)) && a.setAttribute("href", iw)
            });
            Oj(f);
            vf(fw)
        })
    });
    x("yt.www.ads.pyv.showPpvOnWatch", mw);
    x("yt.www.ads.pyv.loadPyvIframe", rw);
    x("yt.www.ads.pyv.loadPyvAfsScript", function (a) {
        xb("/pyv_afs_ads?query=" + a, h)
    });
    (function (a) {
        for (var b = 0, c = arguments.length; b < c; ++b) Ib[arguments[b]] = 1
    })("pyv_related_box_id");
    x("setCompanion", Ew);
    x("setInstreamCompanion", Fw);
    x("setFreewheelCompanion", Gw);
    x("closeInPageAdIframe", Aw);
    x("hideInstreamCompanion", Aw);
    x("closeMpuCompanion", Aw);
    x("setAfvCompanionVars", Hw);
    x("showAfvCompanionAdDiv", Iw);
    x("hideAfvInstreamCompanionAdDiv", Jw);
    hh(jh);
    hh(oh);
    hh(Ah);
    hh(Hh);
    hh(Jh);
    hh(Th);
    hh(Zh);
    hh(Uh);
    hh(ci);
    hh(zi);
    hh(Fi);
    hh(Gi);
    hh(Si);
    hh(ei);
    hh(Vi);
    hh(cj);
    hh(dj);
    x("yt.www.watch.player.init", Uu);
    x("yt.www.watch.player.dispose", function () {
        window.clearInterval(gv);
        Bg(window, "beforeunload", pv);
        Bg(window, "message", ev);
        Nr && (Nr.removeReceiverListener("YouTube", Qr), Nr = n);
        qv = p;
        sv = "";
        Wu = {};
        Su = n;
        Wb(hv);
        hv = []
    });
    x("yt.www.watch.player.seekTo", rv);
    x("yt.www.watch.player.play", function () {
        var a = Su;
        a && a.playVideo()
    });
    x("yt.www.watch.player.saveResumeOffset", ov);
    x("yt.www.watch.player.handleEndPreview", function (a) {
        var b = Su;
        b && b.stopVideo && b.stopVideo();
        (b = L("watch-checkout-offers")) && F("ypc-init-purchase-for-container", b, a)
    });
    x("yt.www.watch.player.openPopup", function (a, b, c) {
        var d = n;
        a = "/tv?v=" + a;
        var e = Su;
        e && (a += "&vq=" + e.getPlaybackQuality(), d = Math.round(e.getCurrentTime()), e.stopVideo());
        d && 10 < d && (a += "&t=" + d);
        bj(a, {
            width: b,
            height: c,
            resizable: m,
            location: p,
            statusbar: p,
            menubar: p,
            scrollbars: p,
            toolbar: p
        })
    });
    x("yt.tracking.social.onAdvertiserVideoView", function (a) {
        if (a) if (a.ad) {
                var b = a.uid,
                    c = a.aid;
                a = a.agcid;
                var d = B("CONVERSION_CONFIG_DICT");
                d && (b && c && d.uid == b) && zf(c);
                d = {
                    channel: b,
                    aid: c,
                    origin: "AD_VIEW"
                };
                (a = Af(d, "adview", a || "!agcid")) && vf(a);
                c && b && pf("aid-" + b, d, 604800)
            } else if (b = a.uid) c = yf(), a = xf(b), !c && !a ? a = n : (d = c && (!a || c != a.aid) ? {
                channel: b,
                aid: c,
                origin: "SHARE"
            } : mb(a), a && "AD_VIEW" == a.origin && (d.saw_ad = m), a = d), a && (!c && a.aid && zf(a.aid), (d = Af(a, "view")) && vf(d), b && (c && !a.saw_ad) && pf("aid-" + b, a, 604800))
    });
    x("checkCurrentVideo", function (a, b, c) {
        var d = B("VIDEO_ID");
        d && d != a && (a = c ? c : Ke(window.location.href, {
            v: a,
            list: b
        })) && aj(a)
    });
    x("trackAnnotationsEvent", function (a, b, c) {
        var d = B("ANALYTICS_ANNOTATIONS_TRACKER");
        window._gaq.push(function () {
            d._trackEvent(a, b, c)
        })
    });
    x("yt.www.comments.initForm", Gm);
    x("yt.www.masthead.performSearch", function (a, b) {
        var c = L("masthead-search"),
            d = T(b, a) || "";
        "rentals" == d ? (c.rental.value = 1, c.search_type.value = "") : (c.search_type.value = d, c.rental.value = 0);
        if (c.search_query.value) c.submit();
        else {
            var c = b.innerHTML,
                e = L("search-btn"),
                f = e.innerHTML,
                k = T(e, a) || "";
            e.innerHTML = c;
            S(e, a, d);
            b.innerHTML = f;
            S(b, a, k)
        }
        return p
    });
    x("yt.www.masthead.dismissGAPlusMessage", function () {
        var a = Pi("FML", "").split(","),
            b = new Date,
            b = Math.round(b.getTime() / 1E3),
            c = "",
            c = 2 != a.length ? "1," + b : parseInt(a[0], 10) + 1 + "," + b;
        Oi("FML", c, 31536E4)
    });
    x("yt.www.masthead.dismissPostLinkingMessage", function () {
        Qi("FML")
    });
    x("yt.www.masthead.dismissCookieAlert", function () {
        Df("GC_OK", h, h);
        kj.getInstance();
        qj(sj.hi, m);
        rj();
        Y(L("google-cookie-alert"));
        J(document.body, "footer-cookie-alert")
    });
    x("yt.www.masthead.toggleExpandedMasthead", function () {
        var a = L("masthead-expanded");
        Lg(a);
        F("masthead-mastfeedr-toggle");
        Jg("masthead-expanded-menu", m);
        Jg("masthead-expanded-acct-sw-container", p);
        var b = L("yt-masthead-dropdown");
        b && Nc(b, "reversed");
        Vp || J(L("masthead-expanded-container"), "accountswitch");
        if (!T(a, "loaded")) {
            if ((b = L("masthead-expanded-menu-gaia-photo")) && !b.src) b.src = T(b, "src");
            R("/playlist_bar_ajax", {
                G: {
                    action_get_playlists_masthead: 1,
                    feature: "mhee"
                },
                format: "JSON",
                He: m,
                B: function (b, d) {
                    L("masthead-expanded-lists-container").innerHTML =
                        d.html;
                    S(a, "loaded", "true");
                    var e = L("yt-masthead-multilogin");
                    if (!T(e, "loaded")) {
                        var f = d.delegate_accounts;
                        if (f) {
                            var k = L("yt-masthead-multilogin-channel-switcher-item");
                            z(f, function (a) {
                                a = ad(a);
                                e.insertBefore(a, k)
                            });
                            S(e, "loaded", "true")
                        }
                    }
                }
            })
        }
    });
    x("yt.www.masthead.accountswitch.init", function (a) {
        Vp = a
    });
    x("yt.www.masthead.accountswitch.toggle", function () {
        Lg("masthead-expanded-acct-sw-container");
        var a = L("masthead-expanded-container"),
            b = L("masthead-expanded-acct-sw-container");
        if (Kg(b)) {
            b.style.top = a.offsetTop + "px";
            G && (yc("7") && !yc("8")) && (b.style.top = a.offsetTop - (b.offsetTop - a.offsetTop) + "px");
            b = L("masthead-expanded-menu-acct-sw-list");
            b.offsetHeight < a.offsetHeight && (b.style.height = a.offsetHeight - 11 + "px");
            var c = L("masthead-expanded-acct-sw-iframe");
            if (!c) {
                var d = L("masthead-expanded-menu-acct-sw-list"),
                    c = Xc("iframe", {
                        id: "masthead-expanded-acct-sw-iframe",
                        frameborder: 0,
                        src: 'javascript:""'
                    });
                dd(c, d)
            }
            c.style.height = b.offsetHeight - 11 + "px";
            Vp || I(a, "accountswitch")
        } else Vp || J(a, "accountswitch")
    });
    x("yt.www.masthead.appbar.toggleMenu", function (a, b) {
        if (b) {
            var c = oh.getInstance(),
                d = qh(c, a),
                c = wh(c, a);
            Pg(c, "position", "fixed");
            Pg(c, "top", d.offsetTop);
            Oj(d)
        }
    });
    x("yt.www.picker.load", function (a) {
        var b = T(a, "picker-key"),
            c = T(a, "picker-position"),
            d = "yt-picker-" + b + "-" + c;
        if (c = L(d)) a = T(a, "button-menu-id") == d, d = T(c, "loaded"), Fx(c, b, !! a, !! d)
    });
    x("yt.www.picker.displayLang", function () {
        Ex("language")
    });
    x("yt.www.masthead.extended.redirectWithNewParam", function (a, b) {
        var c, d, e;
        c = window.location.href;
        c = c.split("#");
        d = 2 == c.length ? "#" + c[1] : "";
        c = c[0];
        e = c; - 1 != e.indexOf("?") ? (e = (e || "").split("#")[0], e = e.split("?", 2), e = Fe(1 < e.length ? e[1] : e[0])) : e = {};
        e[b] = a;
        e["persist_" + b] = "1";
        c = c.split("?");
        c = c[0];
        aj(c, e, d)
    });
    x("yt.www.thumbnaildelayload.classifyAndLoadVisibleImages", Lj);
    x("yt.www.feedback.start", function (a, b, c, d) {
        try {
            c = (c || "59") + "";
            b && pb(px, b);
            var e = B("SESSION_INDEX");
            try {
                var f = Ck();
                f && f.pauseVideo && f.pauseVideo();
                var k = lr.getInstance();
                px.flashVersion = k.getVersion().join(".");
                f && (px.playback_id = f.getVideoData().cpn)
            } catch (l) {}
            a = {
                productId: c,
                locale: a,
                abuseLink: "https://support.google.com/youtube/bin/answer.py?answer=140536"
            };
            e && (a.authuser = e + "");
            d && (a.bucket = d);
            cx(a, px);
            return p
        } catch (q) {
            return m
        }
    });
    x("yt.www.feedback.startHelp", function (a, b, c, d, e) {
        cx({
            productId: (c || "59") + "",
            flow: "help",
            helpCenterPath: d || "/youtube",
            helpCenterContext: e,
            anchor: a,
            locale: b,
            showHelpCenterLink: m
        })
    });
    x("yt.www.channelcard.config", {
        "card-action": "yt.www.channelcard.show",
        "card-class": "yt-channel-card",
        "card-delay-show": 200,
        "card-delegate-show": m,
        orientation: "vertical",
        position: "topright"
    });
    x("yt.www.channelcard.show", function (a, b) {
        var c, d, e = T(b, "id");
        z(bx, function (a) {
            !d && a.g == e && (d = a.target);
            !c && a.target == b && (c = a)
        });
        c || (c = new ax(a, 0, d), bx.push(c));
        c.show()
    });
    x("yt.www.watch.lists.loadThumbnails", kk);
    x("yt.www.watch.lists.getState", function () {
        var a = [],
            b = {}, c = -1,
            d = [],
            e = L("watch7-playlist-tray");
        if (!e) return n;
        z(e.getElementsByTagName("li"), function (e, k) {
            K(e, "playlist-bar-item-playing") && (c = k);
            var l = T(e, "video-id"),
                q = T(e, "video-username"),
                A = T(e, "video-title"),
                q = {
                    id: l,
                    username: q,
                    title: A
                }, A = T(e, "video-clip-start"),
                H = T(e, "video-clip-end");
            a[k] = l;
            b[l] = q;
            d[k] = {
                start: A,
                end: H
            }
        });
        e = L("watch7-playlist-bar-autoplay-button");
        return {
            autoPlay: zh(oh.getInstance(), e),
            clipRanges: d,
            index: c,
            listTitle: T(L("watch7-playlist-data"),
                "list-title"),
            videoData: b,
            videoIds: a
        }
    });
    x("yt.sharing.facebooktokenrefresh.finish", function (a) {
        var b = {
            session_token: C("social_connector_ajax"),
            service: "facebook"
        }, c;
        for (c in a) a.hasOwnProperty(c) && (b[c] = a[c]);
        R("/social_connector_ajax", {
            method: "POST",
            format: "JSON",
            G: {
                action_connect_service: 1
            },
            F: b
        })
    });
    x("yt.www.watch.context.loadThumbnails", cr);
    x("yt.www.watch.activity.getTimeSinceActive", aq);
    x("yt.www.watch.activity.setTimestamp", $p);
    x("yt.www.watch.handleLoadMoreRelated", function () {
        Y("watch-more-related-button");
        X("watch-more-related", "watch-more-related-loading");
        R("/related_ajax", {
            G: {
                video_id: B("VIDEO_ID"),
                action_more_related_videos: 1
            },
            B: function (a, b) {
                var c = L("watch-more-related");
                c.innerHTML = b.html;
                Oj(c)
            }
        })
    });
    x("yt.style.show", X);
    x("yt.style.hide", Y);
    x("yt.tracking.track", function (a, b, c) {
        Df(a, b, c)
    });
    x("yt.tracking.resolution", Ef);
    x("yt.tracking.shareList", function (a, b, c, d, e) {
        Ff(a, {
            list: b,
            v: c
        }, d, e)
    });
    x("yt.tracking.shareVideo", Gf);
    x("yt.tracking.shareUrl", function (a, b, c, d) {
        Ff(a, {
            url: b
        }, c, d)
    });
    x("yt.window.popup", function (a, b) {
        return !bj(a, b)
    });
    x("yt.www.guide.collections.onCollectionPickerShown", function () {
        var a = Ei(),
            b = N("subscription-picker", a),
            a = T(b, "collection-id");
        en(b);
        ln(b, m);
        var c = N("subscription-picker-list", b);
        c.innerHTML = "";
        R("/subscription_ajax?action_list_subscriptions=1", {
            method: "POST",
            F: {
                session_token: C("subscription_ajax"),
                collection_id: a
            },
            B: function (a, e) {
                en(b);
                c.innerHTML = e.response.html_content
            },
            onError: gn(b)
        })
    });
    x("ytbin.www.watch.extra.setup", function () {
        vx();
        E("init", vx);
        E("dispose", Ax);
        Uu();
        E("init", Uu);
        var a = B("THUMB_INIT_DELAY_MS");
        0 < a && !B("THUMB_INIT_IN_CORE") ? D(function () {
            vx();
            Gj()
        }, a) : B("THUMB_INIT_IN_CORE") || Gj();
        E("init", Gj);
        E("dispose", Kj);
        Uw();
        E("init", Uw);
        E("dispose", Xw);
        Hm();
        E("init", Hm);
        E("dispose", Nm);
        B("CREATE_CHANNEL_LIGHTBOX") && (vl(), E("init", vl), E("dispose", wl));
        B("FEED_PRIVACY_LIGHTBOX_ENABLED") && (Kk(), E("init", Kk), E("dispose", Rk));
        B("SHOW_IDENTITY_PROMPT_LIGHTBOX") && (sl(), E("init", sl));
        B("SHOW_LINK_GPLUS_LIGHTBOX") ? (Rl(), E("init", Rl), E("dispose", Ol)) : B("LINK_GPLUS_LIGHTBOX_ENABLED") && (Gl(), E("init", Gl), E("dispose", Ol));
        on();
        E("init", on);
        E("dispose", tn);
        B("WATCH_LATER_VIDEO_ID_TO_LOAD") && So();
        mq();
        E("init", mq);
        Jq();
        E("init", Jq);
        E("dispose", Kq);
        Jx();
        E("init", Jx);
        Zw();
        E("init", Zw);
        ai();
        E("init", bi);
        E("dispose", sf);
        E("init", sf);
        rx();
        E("init", rx);
        E("dispose", tx);
        ux();
        E("init", ux);
        B("SAFETY_MODE_PENDING") && Ex("safetymode");
        B("SANDBAR_ENABLED") && lq();
        B("FACEBOOK_TOKEN_REFRESH_ENABLED") &&
            Ze();
        B("RESOLUTION_TRACKING_ENABLED") && (Ef(), E("init", Ef));
        Bb(B("WATCH_GUIDE_CSS"));
        Ao();
        E("init", function () {
            Ao();
            var a = B("GUIDE_SELECTED_ITEM"),
                c = n,
                d = N("guide-item-selected", Wm);
            d && (c = T(d, "channel-id") || "");
            c != a && (c && J(d, "guide-item-selected"), a && (a = ko(a)) && I(a, "guide-item-selected"))
        });
        E("dispose", Ko);
        E("init", $o);
        E("dispose", cp);
        (a = B("WATCH_TRANSCRIPT_JS")) && Ab(a, function () {
            t("yt.www.watch.transcript.init")()
        });
        (a = B("WATCH_LIVECOMMENTS_JS")) && Ab(a, function () {
            t("yt.www.watch.livecomments.init")()
        });
        (a = B("CACTUS_JS")) && Ab(a, function () {
            t("yt.www.comments.cactus.init")()
        });
        (a = B("WATCH_EDIT_JS")) && Ab(a, function () {
            t("yt.www.watch.edit.init")()
        });
        (a = B("RADIO_JS")) && Ab(a, function () {
            t("yt.www.radio.init")()
        });
        (a = B("SBOX_JS_URL")) && Ab(a, function () {
            t("yt.www.masthead.searchbox.init")()
        });
        (a = B("WATCH_EDITOR_JS")) && Ab(a, function () {
            t("ytbin.www.watch.editor.init")()
        });
        (a = B("WATCH_LIVESTREAMING_JS")) && Ab(a, function () {
            t("yt.www.livestreaming.watchpage.init")()
        });
        (a = B("DYNAMIC_MESSAGE_JS")) && Ab(a, function () {
            t("ytbin.www.watch.dynamicmessages.init")()
        });
        (a = B("WATCH_REFRESH_TIMEOUT")) && D(function () {
            window.location.reload(m)
        }, a);
        (a = B("CHANNEL_SUBSCRIPTION_PROMO_CSS")) && Bb(a);
        (a = B("CHANNEL_SUBSCRIPTION_PROMO_JS")) && Ab(a, function () {
            t("ytbin.www.onboarding.channelsubscriptionpromo.init")()
        });
        (a = B("MIXED_CREDENTIALS_PROMO_JS")) && Ab(a, function () {
            t("ytbin.www.account.mixedcredentialspromo.init")()
        });
        (a = B("COMMENT_MODERATORS_CSS")) && Bb(a);
        (a = B("COMMENT_MODERATORS_JS")) && Ab(a, function () {
            t("ytbin.www.commentmoderators.init")()
        });
        B("YOODLE_IS_ANIMATED") && new Uo(B("YOODLE_ANIMATION_FRAMES"),
            B("YOODLE_ANIMATION_DURATION"), B("YOODLE_ANIMATION_DELAY"))
    });
})();